-
- Downloads
Close time window in event handling unit test
As Dave discussed on #27053 these new unit tests occasionally fail. Think I see what's up: our emit_event() helper blocked until events were consumed but *not* until they were handled. That is to say in the following psudocode... event_loop function: while True: event = event_queue.pop() # <=== right here for listener in listeners: listener(event) ... our tests could make assertions after dequeueing events but before calling the listener, producing the assertion failures he saw. Joining on the event thread to ensure it's done performing any work it has. On the upside this actually simplifies our test code too! :P Ran the tests several dozen times and this seems to do the trick for me but unforuntately since this these test failures could be pretty rare tough to be sure.
Please register or sign in to comment