It looks like in IsolatedAsyncioTestCase when debug() crashes it doesn't teardown the event loop, in addition it seems that if the loop isn't torn down it will happen in __del__ which means thread local sensitive functions like set_event_loop get called via the GC from potentially the wrong thread
Originally posted by @graingert in #95898 (comment)
It looks like in IsolatedAsyncioTestCase when
debug()crashes it doesn't teardown the event loop, in addition it seems that if the loop isn't torn down it will happen in__del__which means thread local sensitive functions likeset_event_loopget called via the GC from potentially the wrong threadOriginally posted by @graingert in #95898 (comment)