Skip to content

Commit

Permalink
add a gc.collect() call to make sure threads are supposed to be clean…
Browse files Browse the repository at this point in the history
…ed up
  • Loading branch information
tswast committed Feb 5, 2025
1 parent e3315a8 commit 3024a0a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/unit/test__pandas_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import datetime
import decimal
import functools
import gc
import operator
import queue
from typing import Union
Expand Down Expand Up @@ -1929,7 +1930,11 @@ def test__download_table_bqstorage_shuts_down_workers(
assert download_state.started_workers == 3
assert download_state.finished_workers == 0

# Stop iteration early and simulate the variables going out of scope
# to be doubly sure that the worker threads are supposed to be cleaned up.
del result_gen, result_gen_iter
gc.collect()

assert download_state.started_workers == 3
assert download_state.finished_workers == 3

Expand Down

0 comments on commit 3024a0a

Please sign in to comment.