ipykernel-5.3.4 changed to ipykernel-5.4.0, and this test stopped working.
flush_channels() seems to fix it.
I don't thoroughly understand what is going on, but my guess is: the new version of ipykernel sends more messages for some reason, the test doesn't consume all of the messages before trying to execute new code, and therefore self.execute_helper interprets some of the old messages as replies to the new code execution and gets confused. So flush_channels() clears out those old messages.
ipykernel-5.3.4 changed to ipykernel-5.4.0, and this test stopped working.
flush_channels()
seems to fix it.I don't thoroughly understand what is going on, but my guess is: the new version of ipykernel sends more messages for some reason, the test doesn't consume all of the messages before trying to execute new code, and therefore
self.execute_helper
interprets some of the old messages as replies to the new code execution and gets confused. Soflush_channels()
clears out those old messages.