Skip to content

urllib: flaky test with python 3.8 #3320

@xrmx

Description

@xrmx

Flaky tests with Python 3.8

 =================================== FAILURES ===================================
__________ TestUrllibMetricsInstrumentation.test_metric_uninstrument ___________

self = <tests.test_metrics_instrumentation.TestUrllibMetricsInstrumentation testMethod=test_metric_uninstrument>

    @mark.skipif(
        python_implementation() == "PyPy", reason="Fails randomly in pypy"
    )
    def test_metric_uninstrument(self):
        with request.urlopen(self.URL):
            self.assertEqual(
                len(
                    (
                        self.memory_metrics_reader.get_metrics_data()
                        .resource_metrics[0]
                        .scope_metrics[0]
                        .metrics
                    )
                ),
                3,
            )
    
>           self.assertEqual(
                (
                    self.memory_metrics_reader.get_metrics_data()
                    .resource_metrics[0]
                    .scope_metrics[0]
                    .metrics[0]
                    .data.data_points[0]
                    .bucket_counts[1]
                ),
                1,
            )
E           AssertionError: 0 != 1

instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py:419: AssertionError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions