google / swift-jupyter

Apache License 2.0
618 stars 90 forks source link

fix test for new ipykernel version #127

Closed marcrasi closed 3 years ago

marcrasi commented 3 years ago

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.

marcrasi commented 3 years ago

This turned out to be no longer necessary because it was a bug in ipykernel that they fixed with a new release. https://github.com/ipython/ipykernel/releases/tag/5.4.2