open-telemetry / open-telemetry/opentelemetry-python

Flaky sdk test on pypy

Open
#5,553 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.6k
Forks
1k
Avg merge
4d 15h
Merged PRs (30d)
19

Description

=================================== FAILURES ===================================
_ TestBatchProcessor.test_record_processor_is_garbage_collected[BatchSpanProcessor-telemetry1] _

self = <tests.shared_internal.test_batch_processor.TestBatchProcessor object at 0x000000002da681e0>
batch_processor_class = <class 'opentelemetry.sdk.trace.export.BatchSpanProcessor'>
telemetry = <opentelemetry.sdk.trace.ReadableSpan object at 0x000000002da11600>

    def test_record_processor_is_garbage_collected(self, batch_processor_class, telemetry):
        exporter = Mock()
        processor = batch_processor_class(exporter)
        weak_ref = weakref.ref(processor)
        processor.shutdown()
    
        # When the processor is garbage collected
        del processor
        gc.collect()
    
        # Then the reference to the processor should no longer exist
>       assert weak_ref() is None
E       AssertionError: assert <opentelemetry.sdk.trace.export.BatchSpanProcessor object at 0x0000000031a74368> is None
E        +  where <opentelemetry.sdk.trace.export.BatchSpanProcessor object at 0x0000000031a74368> = <weakref at 0x00007f07dbdf37a0; to 'BatchSpanProcessor'>()

opentelemetry-sdk/tests/shared_internal/test_batch_processor.py:204: AssertionError

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with opentelemetry-sdk/tests/shared_internal/test_batch_processor.py and test_record_processor_is_garbage_collected; run that test under PyPy and compare the reference behavior with the test's assumptions. Make the test reliably validate processor collection on PyPy, then rerun the focused test and relevant batch-processor tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.