File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ import atexit
34import threading
45import typing
56from collections import defaultdict
2021
2122logger = getLogger ("openfeature" )
2223_event_executor = ThreadPoolExecutor (thread_name_prefix = "openfeature-event-handler" )
24+ atexit .register (_event_executor .shutdown , wait = True )
2325
2426_global_lock = threading .RLock ()
2527_global_handlers : dict [ProviderEvent , list [EventHandler ]] = defaultdict (list )
Original file line number Diff line number Diff line change @@ -643,7 +643,8 @@ def slow_handler(details):
643643
644644 # Then
645645 assert handler_started .wait (timeout = 1 )
646- assert elapsed < 0.2
646+ # emit must return well before the handler's blocking wait (1s) would finish
647+ assert elapsed < 0.5
647648 release_handler .set ()
648649 assert handler_finished .wait (timeout = 1 )
649650
You can’t perform that action at this time.
0 commit comments