From 0c137c5695be9a643386d37fcb4731f1baf4c753 Mon Sep 17 00:00:00 2001 From: prha <1040172+prha@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:41:09 -0800 Subject: [PATCH] raise exceptions if encountered in threaded concurrency test (#26263) ## Summary & Motivation Need more traces in debugging spurious sqlite threaded tests. ## How I Tested These Changes BK --- .../storage_tests/utils/event_log_storage.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/python_modules/dagster/dagster_tests/storage_tests/utils/event_log_storage.py b/python_modules/dagster/dagster_tests/storage_tests/utils/event_log_storage.py index 6831b55aca3de..010278fcad892 100644 --- a/python_modules/dagster/dagster_tests/storage_tests/utils/event_log_storage.py +++ b/python_modules/dagster/dagster_tests/storage_tests/utils/event_log_storage.py @@ -5118,20 +5118,16 @@ def _occupy_slot(key: str): time.sleep(0.05) storage.free_concurrency_slot_for_step(run_id, key) - start = time.time() with ThreadPoolExecutor() as executor: - futures = [executor.submit(_occupy_slot, str(i)) for i in range(100)] - while not all(f.done() for f in futures) and time.time() < start + TOTAL_TIMEOUT_TIME: - time.sleep(0.1) - + list( + executor.map(_occupy_slot, [str(i) for i in range(100)], timeout=TOTAL_TIMEOUT_TIME) + ) foo_info = storage.get_concurrency_info("foo") assert foo_info.slot_count == 5 assert foo_info.active_slot_count == 0 assert foo_info.pending_step_count == 0 assert foo_info.assigned_step_count == 0 - assert all(f.done() for f in futures) - def test_zero_concurrency(self, storage: EventLogStorage): assert storage if not storage.supports_global_concurrency_limits: