Skip to content

TestConcurrentMultiSpanProcessor.test_force_flush_late_by_timeout failure #4543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
xrmx opened this issue Apr 15, 2025 · 0 comments
Open

Comments

@xrmx
Copy link
Contributor

xrmx commented Apr 15, 2025

With python 3.8 on windows on a branch on top of e5a9307:

______ TestConcurrentMultiSpanProcessor.test_force_flush_late_by_timeout ______

self = <tests.trace.test_span_processor.TestConcurrentMultiSpanProcessor testMethod=test_force_flush_late_by_timeout>

    @mark.skipif(
        python_implementation() == "PyPy" and system() == "Windows",
        reason="This test randomly fails in Windows with PyPy",
    )
    def test_force_flush_late_by_timeout(self):
        multi_processor = trace.ConcurrentMultiSpanProcessor(5)
        wait_event = Event()
    
        def delayed_flush(_):
            wait_event.wait()
    
        late_mock = mock.Mock(spec=trace.SpanProcessor)
        late_mock.force_flush = mock.Mock(side_effect=delayed_flush)
        mocks = [mock.Mock(spec=trace.SpanProcessor) for _ in range(0, 4)]
        mocks.insert(0, late_mock)
    
        for mock_processor in mocks:
            multi_processor.add_span_processor(mock_processor)
    
        flushed = multi_processor.force_flush(timeout_millis=10)
        # let the thread executing the late_mock continue
        wait_event.set()
    
        self.assertFalse(flushed)
        for mock_processor in mocks:
>           self.assertEqual(1, mock_processor.force_flush.call_count)
E           AssertionError: 1 != 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant