Skip to content

test_start_span_custom_start_time fails randomly #900

@jd

Description

@jd
=================================== FAILURES ===================================
_________________ TestTracer.test_start_span_custom_start_time _________________

self = <tests.opentracer.test_tracer.TestTracer object at 0x7fe6bdcb8a58>
ot_tracer = <ddtrace.opentracer.tracer.Tracer object at 0x7fe6be32ccc0>

    def test_start_span_custom_start_time(self, ot_tracer):
        """Start a span with a custom start time."""
        import time
    
        t = time.time() + 0.002
        with ot_tracer.start_span('myop', start_time=t) as span:
            time.sleep(0.005)
    
        # it should be certain that the span duration is strictly less than
        # the amount of time we sleep for
>       assert span._dd_span.duration < 0.005
E       assert 0.007131099700927734 < 0.005
E        +  where 0.007131099700927734 = <Span(id=760474509597788229,trace_id=3017630132355656079,parent_id=None,name=myop)>.duration
E        +    where <Span(id=760474509597788229,trace_id=3017630132355656079,parent_id=None,name=myop)> = <ddtrace.opentracer.span.Span object at 0x7fe6be32cf60>._dd_span

tests/opentracer/test_tracer.py:136: AssertionError
===================== 1 failed, 63 passed in 0.61 seconds ======================

https://circleci.com/gh/DataDog/dd-trace-py/118474

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions