From 43e89eb6ee360109a3114e195e8800b08def2af1 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Sat, 5 Mar 2022 10:44:52 -0800 Subject: [PATCH] Catch KeyError as a failure of multithreading as well. --- tests/test_synced_collections/synced_collection_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_synced_collections/synced_collection_test.py b/tests/test_synced_collections/synced_collection_test.py index 2b269f8b4..a4df8876e 100644 --- a/tests/test_synced_collections/synced_collection_test.py +++ b/tests/test_synced_collections/synced_collection_test.py @@ -481,7 +481,7 @@ def set_value(sd): try: with ThreadPoolExecutor(max_workers=num_threads) as executor: list(executor.map(set_value, [synced_collection] * num_threads * 10)) - except (RuntimeError, JSONDecodeError): + except (RuntimeError, JSONDecodeError, KeyError): # This line may raise an exception, or it may successfully complete # but not modify all the expected data. If it raises an exception, # then the underlying data is likely to be invalid, so we must