Skip to content

Commit 4d5215d

Browse files
committed
Run gc before counting threads in producer test
1 parent 22e6336 commit 4d5215d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/test_producer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def test_end_to_end(kafka_broker, compression):
7272
@pytest.mark.skipif(platform.python_implementation() != 'CPython',
7373
reason='Test relies on CPython-specific gc policies')
7474
def test_kafka_producer_gc_cleanup():
75+
gc.collect()
7576
threads = threading.active_count()
7677
producer = KafkaProducer(api_version='0.9') # set api_version explicitly to avoid auto-detection
7778
assert threading.active_count() == threads + 1

0 commit comments

Comments
 (0)