Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests broken with ipykernel 4.7.0 #107

Closed
mdickinson opened this issue Dec 6, 2017 · 9 comments · Fixed by #123
Closed

Tests broken with ipykernel 4.7.0 #107

mdickinson opened this issue Dec 6, 2017 · 9 comments · Fixed by #123

Comments

@mdickinson
Copy link
Member

The recent release of ipykernel 4.7.0 appears to break Envisage.

Sample failures, from https://travis-ci.org/enthought/envisage/jobs/312429428 (the later failures are probably consequences of the first one):

======================================================================
ERROR: test_initial_namespace (envisage.plugins.ipython_kernel.tests.test_internal_ipkernel.TestInternalIPKernel)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/enthought/envisage/envisage/plugins/ipython_kernel/tests/test_internal_ipkernel.py", line 45, in test_initial_namespace
    kernel.shutdown()
  File "/home/travis/build/enthought/envisage/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 88, in shutdown
    self.ipkernel.shell.exit_now = True
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/traitlets/traitlets.py", line 585, in __set__
    self.set(obj, value)
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/traitlets/traitlets.py", line 574, in set
    obj._notify_trait(self.name, old_value, new_value)
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/traitlets/traitlets.py", line 1139, in _notify_trait
    type='change',
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/traitlets/traitlets.py", line 1176, in notify_change
    c(change)
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/ipykernel/zmqshell.py", line 472, in _update_exit_now
    loop = self.kernel.io_loop
AttributeError: 'IPythonKernel' object has no attribute 'io_loop'
======================================================================
ERROR: test_io_pub_thread_stopped (envisage.plugins.ipython_kernel.tests.test_internal_ipkernel.TestInternalIPKernel)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/enthought/envisage/envisage/plugins/ipython_kernel/tests/test_internal_ipkernel.py", line 49, in test_io_pub_thread_stopped
    kernel.init_ipkernel(gui_backend=None)
  File "/home/travis/build/enthought/envisage/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 62, in init_ipkernel
    self.ipkernel = gui_kernel(gui_backend)
  File "/home/travis/build/enthought/envisage/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 28, in gui_kernel
    kernel.initialize(argv)
  File "<decorator-gen-121>", line 2, in initialize
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 448, in initialize
    self.init_sockets()
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 238, in init_sockets
    self.shell_port = self._bind_socket(self.shell_socket, self.shell_port)
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 180, in _bind_socket
    s.bind("tcp://%s:%i" % (self.ip, port))
  File "zmq/backend/cython/socket.pyx", line 495, in zmq.backend.cython.socket.Socket.bind
  File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc
    raise ZMQError(errno)
ZMQError: Address already in use
======================================================================
ERROR: test_lifecycle (envisage.plugins.ipython_kernel.tests.test_internal_ipkernel.TestInternalIPKernel)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/enthought/envisage/envisage/plugins/ipython_kernel/tests/test_internal_ipkernel.py", line 28, in test_lifecycle
    kernel.init_ipkernel(gui_backend=None)
  File "/home/travis/build/enthought/envisage/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 62, in init_ipkernel
    self.ipkernel = gui_kernel(gui_backend)
  File "/home/travis/build/enthought/envisage/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 28, in gui_kernel
    kernel.initialize(argv)
  File "<decorator-gen-121>", line 2, in initialize
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 448, in initialize
    self.init_sockets()
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 238, in init_sockets
    self.shell_port = self._bind_socket(self.shell_socket, self.shell_port)
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 180, in _bind_socket
    s.bind("tcp://%s:%i" % (self.ip, port))
  File "zmq/backend/cython/socket.pyx", line 495, in zmq.backend.cython.socket.Socket.bind
  File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc
    raise ZMQError(errno)
ZMQError: Address already in use
======================================================================
ERROR: test_kernel_namespace_extension_point (envisage.plugins.ipython_kernel.tests.test_ipython_kernel_plugin.TestIPythonKernelPlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/enthought/envisage/envisage/plugins/ipython_kernel/tests/test_ipython_kernel_plugin.py", line 58, in test_kernel_namespace_extension_point
    kernel.init_ipkernel(gui_backend=None)
  File "/home/travis/build/enthought/envisage/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 62, in init_ipkernel
    self.ipkernel = gui_kernel(gui_backend)
  File "/home/travis/build/enthought/envisage/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 28, in gui_kernel
    kernel.initialize(argv)
  File "<decorator-gen-121>", line 2, in initialize
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 448, in initialize
    self.init_sockets()
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 238, in init_sockets
    self.shell_port = self._bind_socket(self.shell_socket, self.shell_port)
  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 180, in _bind_socket
    s.bind("tcp://%s:%i" % (self.ip, port))
  File "zmq/backend/cython/socket.pyx", line 495, in zmq.backend.cython.socket.Socket.bind
  File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc
    raise ZMQError(errno)
ZMQError: Address already in use
@mdickinson
Copy link
Member Author

Steps to reproduce with current master: using a Python environment that has click installed:

  1. Edit etstool.py to remove ipykernel from the list of packages (the current version of ipykernel provided by EDM is 4.6)
  2. python etstool.py install
  3. edm run -e envisage-test-3.5-null -- pip install ipykernel
  4. python etstool.py test
Test output
taniyama:envisage mdickinson$ python etstool.py test
Running tests in 'envisage-test-3.5-null'
copying file to tempdir: .coveragerc
[EXECUTING] edm run -e envisage-test-3.5-null -- coverage run -p -m nose.core -v envisage --nologcapture
browse this module ... parsing module /Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/developer/code_browser/tests/code_browser_test_case.py
parsed module /Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/developer/code_browser/tests/code_browser_test_case.py
ok
has traits ... parsing module /Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/developer/code_browser/tests/example_1.py
parsed module /Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/developer/code_browser/tests/example_1.py
ok
test_initial_namespace (envisage.plugins.ipython_kernel.tests.test_internal_ipkernel.TestInternalIPKernel) ... Using selector: KqueueSelector
NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.

To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.

To read more about this, see https://github.com/ipython/ipython/issues/2049


To connect another client to this kernel, use:
    --existing kernel-48706.json
Using selector: KqueueSelector
ERROR
test_io_pub_thread_stopped (envisage.plugins.ipython_kernel.tests.test_internal_ipkernel.TestInternalIPKernel) ... ERROR
test_lifecycle (envisage.plugins.ipython_kernel.tests.test_internal_ipkernel.TestInternalIPKernel) ... ERROR
test_import_from_api (envisage.plugins.ipython_kernel.tests.test_ipython_kernel_plugin.TestIPythonKernelPlugin) ... ok
test_kernel_namespace_extension_point (envisage.plugins.ipython_kernel.tests.test_ipython_kernel_plugin.TestIPythonKernelPlugin) ... ---------- application starting ----------
plugin envisage.core starting
plugin <envisage.plugins.ipython_kernel.tests.test_ipython_kernel_plugin.TestIPythonKernelPlugin.test_kernel_namespace_extension_point.<locals>.NamespacePlugin object at 0x11100df10> has no Id - using <envisage.plugins.ipython_kernel.tests.test_ipython_kernel_plugin.NamespacePlugin>
extensions to <envisage.preferences> <[[], [], []]>
loading preferences from </Users/mdickinson/.enthought/test/preferences.ini>
extensions to <envisage.class_load_hooks> <[[], [], []]>
extensions to <envisage.categories> <[[], [], []]>
extensions to <envisage.service_offers> <[[], [<envisage.service_offer.ServiceOffer object at 0x111320990>], []]>
service <1> registered envisage.plugins.ipython_kernel.internal_ipkernel.InternalIPKernel
plugin envisage.core started
plugin envisage.plugins.ipython_kernel starting
plugin envisage.plugins.ipython_kernel started
plugin envisage.plugins.ipython_kernel.tests.test_ipython_kernel_plugin.NamespacePlugin starting
plugin envisage.plugins.ipython_kernel.tests.test_ipython_kernel_plugin.NamespacePlugin started
---------- application started ----------
extensions to <ipython_plugin.namespace> <[[], [], [('y', 'hi')]]>
---------- application stopping ----------
plugin envisage.plugins.ipython_kernel.tests.test_ipython_kernel_plugin.NamespacePlugin stopping
plugin envisage.plugins.ipython_kernel.tests.test_ipython_kernel_plugin.NamespacePlugin stopped
plugin envisage.plugins.ipython_kernel stopping
Shutting down the embedded ipython kernel
plugin envisage.plugins.ipython_kernel stopped
plugin envisage.core stopping
service <1> unregistered
plugin envisage.core stopped
saving preferences to </Users/mdickinson/.enthought/test/preferences.ini>
---------- application stopped ----------
ERROR
test_kernel_service (envisage.plugins.ipython_kernel.tests.test_ipython_kernel_plugin.TestIPythonKernelPlugin) ... ---------- application starting ----------
plugin envisage.core starting
extensions to <envisage.preferences> <[[], []]>
loading preferences from </Users/mdickinson/.enthought/test/preferences.ini>
extensions to <envisage.class_load_hooks> <[[], []]>
extensions to <envisage.categories> <[[], []]>
extensions to <envisage.service_offers> <[[], [<envisage.service_offer.ServiceOffer object at 0x1113333b8>]]>
service <1> registered envisage.plugins.ipython_kernel.internal_ipkernel.InternalIPKernel
plugin envisage.core started
plugin envisage.plugins.ipython_kernel starting
plugin envisage.plugins.ipython_kernel started
---------- application started ----------
extensions to <ipython_plugin.namespace> <[[], []]>
ERROR
Can the Server communicate with Clients and handle errors ... Server listening on port 53229...
Server received: ping 53230
Server received: ping 53233
Server received: ping 53234
Server received: register 53238client1client2
Client listening on port 53238...
Server received: register 53241client2client1
Client listening on port 53241...
Client on port 53238 received: __keepalive__ 
Client on port 53241 received: __orphaned__ 0
Client on port 53238 received: __orphaned__ 0
Client on port 53238 sending: foo bar
Server received: send 53238foobar
Client on port 53241 received: foo bar
Client on port 53238 sending: Très bien
Server received: send 53238Trèsbien
Client on port 53241 received: Très bien
Server received: unregister 53238
Client on port 53241 received: __orphaned__ 1
Server received: ping 53252
Client listening on port 53255...
Server received: register 53255client1client2
Client on port 53241 received: __keepalive__ 
Client on port 53255 received: __orphaned__ 0
Client on port 53241 received: __orphaned__ 0
Client on port 53255 received: dummy 
Server received: unregister 53255
Client on port 53241 received: __orphaned__ 1
Client on port 53241 sending: foo bar
Server received: send 53241foobar
No spawn command is defined for object type 'client1'.
Client on port 53241 received: __error__ 1No spawn command is defined for object type 'client1'.
Error status received from the server: 1
No spawn command is defined for object type 'client1'.
ok
file resource ... ok
http resource ... ok
no such file resource ... ok
no such http resource ... ok
no such package resource ... ok
package resource ... ok
unknown protocol ... ok
action with non-existent group ... ok
action with non-existent sibling ... ok
action with path component that is not a menu ... ok
actions and menus in groups ... ok
actions make submenus ... ok
actions make submenus before and after ... ok
actions no groups ... ok
duplicate group ... ok
duplicate menu ... ok
explicit groups ... ok
group with non-existent sibling ... ok
menu with non-existent sibling ... ok
single top level group ... ok
single top level menu with no group ... ok
sub-menus no groups ... ok
top level menu group ... ok
top level menu non-existent group ... ok
top level menus no groups, before and after ... ok
top level menus with_no groups ... ok
add extension point listener ... ---------- application starting ----------
plugin A starting
plugin A started
plugin B starting
plugin B started
---------- application started ----------
extensions to <a.x> <[[], [1, 2, 3]]>
ok
add plugin ... ---------- application starting ----------
plugin A starting
plugin A started
plugin B starting
plugin B started
---------- application started ----------
extensions to <a.x> <[[], [1, 2, 3]]>
ok
extension point ... ---------- application starting ----------
plugin A starting
plugin A started
plugin B starting
plugin B started
plugin C starting
plugin C started
---------- application started ----------
extensions to <a.x> <[[], [1, 2, 3], [98, 99, 100]]>
ok
get plugin ... ---------- application starting ----------
plugin A starting
plugin A started
plugin B starting
plugin B started
plugin C starting
plugin C started
---------- application started ----------
ok
home ... ok
no plugins ... ---------- application starting ----------
---------- application started ----------
---------- application stopping ----------
loading preferences from </Users/mdickinson/.enthought/test/preferences.ini>
saving preferences to </Users/mdickinson/.enthought/test/preferences.ini>
---------- application stopped ----------
ok
remove extension point listener ... ---------- application starting ----------
plugin A starting
plugin A started
---------- application started ----------
extensions to <a.x> <[[]]>
ok
remove plugin ... ---------- application starting ----------
plugin A starting
plugin A started
plugin B starting
plugin B started
plugin C starting
plugin C started
---------- application started ----------
extensions to <a.x> <[[], [1, 2, 3], [98, 99, 100]]>
ok
set plugin manager at construction time ... ---------- application starting ----------
plugin A starting
plugin A started
plugin B starting
plugin B started
plugin C starting
plugin C started
---------- application started ----------
ok
start and stop errors ... ---------- application starting ----------
plugin <envisage.tests.application_test_case.SimplePlugin object at 0x11108f620> has no Id - using <envisage.tests.application_test_case.SimplePlugin>
plugin envisage.tests.application_test_case.SimplePlugin starting
plugin envisage.tests.application_test_case.SimplePlugin started
plugin <envisage.tests.application_test_case.BadPlugin object at 0x11108f780> has no Id - using <envisage.tests.application_test_case.BadPlugin>
plugin envisage.tests.application_test_case.BadPlugin starting
---------- application stopping ----------
plugin envisage.tests.application_test_case.BadPlugin stopping
ok
veto starting ... ---------- application starting ----------
---------- application start vetoed ----------
ok
veto stopping ... ---------- application starting ----------
---------- application started ----------
---------- application stopping ----------
---------- application stop vetoed ----------
ok
class already loaded ... ok
connect ... ok
disconnect ... ok
test_application_gets_propogated_to_plugin_managers (envisage.tests.composite_plugin_manager_test_case.CompositePluginManagerTestCase) ... ok
test_correct_exception_propagated_from_plugin_manager (envisage.tests.composite_plugin_manager_test_case.CompositePluginManagerTestCase) ... ok
test_find_no_plugins_if_there_are_no_plugin_managers (envisage.tests.composite_plugin_manager_test_case.CompositePluginManagerTestCase) ... ok
test_find_no_plugins_if_there_are_no_plugins_in_plugin_managers (envisage.tests.composite_plugin_manager_test_case.CompositePluginManagerTestCase) ... ok
test_find_plugins_in_a_multiple_plugin_managers (envisage.tests.composite_plugin_manager_test_case.CompositePluginManagerTestCase) ... plugin <envisage.tests.composite_plugin_manager_test_case.SimplePlugin object at 0x110ff8518> has no Id - using <envisage.tests.composite_plugin_manager_test_case.SimplePlugin>
plugin <envisage.tests.composite_plugin_manager_test_case.SimplePlugin object at 0x11108ffc0> has no Id - using <envisage.tests.composite_plugin_manager_test_case.SimplePlugin>
plugin <envisage.tests.composite_plugin_manager_test_case.SimplePlugin object at 0x11108fe08> has no Id - using <envisage.tests.composite_plugin_manager_test_case.SimplePlugin>
plugin red starting
plugin red started
plugin yellow starting
plugin yellow started
plugin green starting
plugin green started
plugin green stopping
plugin green stopped
plugin yellow stopping
plugin yellow stopped
plugin red stopping
plugin red stopped
ok
test_find_plugins_in_a_single_plugin_manager (envisage.tests.composite_plugin_manager_test_case.CompositePluginManagerTestCase) ... plugin <envisage.tests.composite_plugin_manager_test_case.SimplePlugin object at 0x110ff8518> has no Id - using <envisage.tests.composite_plugin_manager_test_case.SimplePlugin>
plugin <envisage.tests.composite_plugin_manager_test_case.SimplePlugin object at 0x11108ff68> has no Id - using <envisage.tests.composite_plugin_manager_test_case.SimplePlugin>
plugin red starting
plugin red started
plugin yellow starting
plugin yellow started
plugin yellow stopping
plugin yellow stopped
plugin red stopping
plugin red stopped
ok
test_propogate_plugin_added_or_remove_events_from_plugin_managers (envisage.tests.composite_plugin_manager_test_case.CompositePluginManagerTestCase) ... plugin <envisage.plugin.Plugin object at 0x11108ff68> has no Id - using <envisage.plugin.Plugin>
ok
categories ... ---------- application starting ----------
plugin envisage.core starting
extensions to <envisage.preferences> <[[], []]>
loading preferences from </Users/mdickinson/.enthought/core.plugin.test/preferences.ini>
extensions to <envisage.class_load_hooks> <[[], []]>
extensions to <envisage.categories> <[[], [<envisage.category.Category object at 0x1110aa728>]]>
extensions to <envisage.service_offers> <[[], []]>
plugin envisage.core started
plugin A starting
plugin A started
---------- application started ----------
ok
class load hooks ... ---------- application starting ----------
plugin envisage.core starting
extensions to <envisage.preferences> <[[], []]>
loading preferences from </Users/mdickinson/.enthought/core.plugin.test/preferences.ini>
extensions to <envisage.class_load_hooks> <[[], [<envisage.class_load_hook.ClassLoadHook object at 0x1110aa830>]]>
extensions to <envisage.categories> <[[], []]>
extensions to <envisage.service_offers> <[[], []]>
plugin envisage.core started
plugin A starting
plugin A started
---------- application started ----------
ok
dynamically added category ... ---------- application starting ----------
plugin envisage.core starting
extensions to <envisage.preferences> <[[]]>
loading preferences from </Users/mdickinson/.enthought/core.plugin.test/preferences.ini>
extensions to <envisage.class_load_hooks> <[[]]>
extensions to <envisage.categories> <[[]]>
extensions to <envisage.service_offers> <[[]]>
plugin envisage.core started
---------- application started ----------
ok
dynamically class load hooks ... ---------- application starting ----------
plugin envisage.core starting
extensions to <envisage.preferences> <[[]]>
loading preferences from </Users/mdickinson/.enthought/core.plugin.test/preferences.ini>
extensions to <envisage.class_load_hooks> <[[]]>
extensions to <envisage.categories> <[[]]>
extensions to <envisage.service_offers> <[[]]>
plugin envisage.core started
---------- application started ----------
ok
dynamically added preferences ... ---------- application starting ----------
plugin envisage.core starting
extensions to <envisage.preferences> <[[]]>
loading preferences from </Users/mdickinson/.enthought/core.plugin.test/preferences.ini>
extensions to <envisage.class_load_hooks> <[[]]>
extensions to <envisage.categories> <[[]]>
extensions to <envisage.service_offers> <[[]]>
plugin envisage.core started
---------- application started ----------
loading preferences from <<_io.BufferedReader name='/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/tests/preferences.ini'>>
ok
dynamically added service offer ... ---------- application starting ----------
plugin envisage.core starting
extensions to <envisage.preferences> <[[]]>
loading preferences from </Users/mdickinson/.enthought/core.plugin.test/preferences.ini>
extensions to <envisage.class_load_hooks> <[[]]>
extensions to <envisage.categories> <[[]]>
extensions to <envisage.service_offers> <[[]]>
plugin envisage.core started
---------- application started ----------
service <1> registered envisage.tests.core_plugin_test_case.IMyService
ok
preferences ... ---------- application starting ----------
plugin envisage.core starting
extensions to <envisage.preferences> <[[], ['file:///Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/tests/preferences.ini']]>
loading preferences from </Users/mdickinson/.enthought/core.plugin.test/preferences.ini>
loading preferences from <<_io.BufferedReader name='/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/tests/preferences.ini'>>
extensions to <envisage.class_load_hooks> <[[], []]>
extensions to <envisage.categories> <[[], []]>
extensions to <envisage.service_offers> <[[], []]>
plugin envisage.core started
plugin A starting
plugin A started
---------- application started ----------
---------- application stopping ----------
plugin A stopping
plugin A stopped
plugin envisage.core stopping
plugin envisage.core stopped
saving preferences to </Users/mdickinson/.enthought/core.plugin.test/preferences.ini>
---------- application stopped ----------
ok
service offers ... ---------- application starting ----------
plugin envisage.core starting
extensions to <envisage.preferences> <[[], []]>
loading preferences from </Users/mdickinson/.enthought/core.plugin.test/preferences.ini>
extensions to <envisage.class_load_hooks> <[[], []]>
extensions to <envisage.categories> <[[], []]>
extensions to <envisage.service_offers> <[[], [<envisage.service_offer.ServiceOffer object at 0x111155780>]]>
service <1> registered envisage.tests.core_plugin_test_case.IMyService
plugin envisage.core started
plugin A starting
plugin A started
---------- application started ----------
plugin envisage.core stopping
service <1> unregistered
plugin envisage.core stopped
ok
test_find_plugins_in_eggs_on_the_plugin_path (envisage.tests.egg_basket_plugin_manager_test_case.EggBasketPluginManagerTestCase) ... egg basket plugin manager found plugins <[<acme.foo.foo_plugin.FooPlugin object at 0x1112cfeb8>, <acme.bar.bar_plugin.BarPlugin object at 0x1112cfdb0>, <acme.baz.baz_plugin.BazPlugin object at 0x1112cfd58>]>
ok
test_ignore_broken_distributions_loads_good_distributions (envisage.tests.egg_basket_plugin_manager_test_case.EggBasketPluginManagerTestCase) ... Error loading distributions: {acme.foo 0.1a11 (/private/var/folders/6d/lyq0l1nx3c74lk1lkr4z7hn80000gn/T/tmpp6xm7492/acme.foo-0.1a11-py3.5.egg): VersionConflict(acme.foo 0.1a1 (/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/tests/eggs/acme.foo-0.1a1-py3.5.egg), Requirement.parse('acme.foo==0.1a11'))}
egg basket plugin manager found plugins <[<acme.foo.foo_plugin.FooPlugin object at 0x1112cfd58>, <acme.bar.bar_plugin.BarPlugin object at 0x1111678e0>, <acme.baz.baz_plugin.BazPlugin object at 0x111155150>]>
ok
test_ignore_broken_distributions_raises_exceptions_by_default (envisage.tests.egg_basket_plugin_manager_test_case.EggBasketPluginManagerTestCase) ... Error loading distributions: {acme.foo 0.1a11 (/private/var/folders/6d/lyq0l1nx3c74lk1lkr4z7hn80000gn/T/tmpznkpthwq/acme.foo-0.1a11-py3.5.egg): VersionConflict(acme.foo 0.1a1 (/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/tests/eggs/acme.foo-0.1a1-py3.5.egg), Requirement.parse('acme.foo==0.1a11'))}
ok
test_ignore_broken_plugins_loads_good_plugins (envisage.tests.egg_basket_plugin_manager_test_case.EggBasketPluginManagerTestCase) ... Error loading plugin: acme.bad (from /Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/tests/bad_eggs/acme.bad-0.1a1-py3.5.egg)
Traceback (most recent call last):
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/egg_basket_plugin_manager.py", line 119, in _harvest_plugins_in_eggs
    application)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/egg_basket_plugin_manager.py", line 77, in _create_plugin_from_entry_point
    klass  = ep.load()
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2408, in load
    return self.resolve()
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2414, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ImportError: No module named 'acme.bad'

egg basket plugin manager found plugins <[<acme.foo.foo_plugin.FooPlugin object at 0x111167780>, <acme.bar.bar_plugin.BarPlugin object at 0x1112cfe08>, <acme.baz.baz_plugin.BazPlugin object at 0x11120b1a8>]>
ok
test_ignore_broken_plugins_raises_exceptions_by_default (envisage.tests.egg_basket_plugin_manager_test_case.EggBasketPluginManagerTestCase) ... Error loading plugin: acme.bad (from /Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/tests/bad_eggs/acme.bad-0.1a1-py3.5.egg)
Traceback (most recent call last):
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/egg_basket_plugin_manager.py", line 119, in _harvest_plugins_in_eggs
    application)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/egg_basket_plugin_manager.py", line 77, in _create_plugin_from_entry_point
    klass  = ep.load()
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2408, in load
    return self.resolve()
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2414, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ImportError: No module named 'acme.bad'

ok
test_ignore_plugins_matching_a_wildcard_in_the_exclude_list (envisage.tests.egg_basket_plugin_manager_test_case.EggBasketPluginManagerTestCase) ... egg basket plugin manager found plugins <[<acme.foo.foo_plugin.FooPlugin object at 0x111155410>]>
plugin acme.foo starting
plugin acme.foo started
plugin acme.foo stopping
plugin acme.foo stopped
ok
test_ignore_plugins_whose_ids_are_in_the_exclude_list (envisage.tests.egg_basket_plugin_manager_test_case.EggBasketPluginManagerTestCase) ... egg basket plugin manager found plugins <[<acme.bar.bar_plugin.BarPlugin object at 0x11091cfc0>]>
plugin acme.bar starting
plugin acme.bar started
plugin acme.bar stopping
plugin acme.bar stopped
ok
test_only_find_plugins_matching_a_wildcard_in_the_include_list (envisage.tests.egg_basket_plugin_manager_test_case.EggBasketPluginManagerTestCase) ... egg basket plugin manager found plugins <[<acme.bar.bar_plugin.BarPlugin object at 0x111167780>, <acme.baz.baz_plugin.BazPlugin object at 0x1112cfe08>]>
plugin acme.bar starting
plugin acme.bar started
plugin acme.baz starting
plugin acme.baz started
plugin acme.baz stopping
plugin acme.baz stopped
plugin acme.bar stopping
plugin acme.bar stopped
ok
test_only_find_plugins_whose_ids_are_in_the_include_list (envisage.tests.egg_basket_plugin_manager_test_case.EggBasketPluginManagerTestCase) ... egg basket plugin manager found plugins <[<acme.foo.foo_plugin.FooPlugin object at 0x11114aca8>, <acme.bar.bar_plugin.BarPlugin object at 0x11114abf8>]>
plugin acme.foo starting
plugin acme.foo started
plugin acme.bar starting
plugin acme.bar started
plugin acme.bar stopping
plugin acme.bar stopped
plugin acme.foo stopping
plugin acme.foo stopped
ok
test_reflect_changes_to_the_plugin_path (envisage.tests.egg_basket_plugin_manager_test_case.EggBasketPluginManagerTestCase) ... egg basket plugin manager found plugins <[]>
egg basket plugin manager found plugins <[<acme.foo.foo_plugin.FooPlugin object at 0x1112cfd58>, <acme.bar.bar_plugin.BarPlugin object at 0x1112cfeb8>, <acme.baz.baz_plugin.BazPlugin object at 0x1112cfdb0>]>
egg basket plugin manager found plugins <[]>
ok
exclude multiple ... egg plugin manager found plugins <[<acme.foo.foo_plugin.FooPlugin object at 0x1112cfeb8>]>
plugin acme.foo starting
plugin acme.foo started
plugin acme.foo stopping
plugin acme.foo stopped
ok
exclude specific ... egg plugin manager found plugins <[<acme.bar.bar_plugin.BarPlugin object at 0x111155150>]>
plugin acme.bar starting
plugin acme.bar started
plugin acme.bar stopping
plugin acme.bar stopped
ok
include multiple ... egg plugin manager found plugins <[<acme.foo.foo_plugin.FooPlugin object at 0x1112cfd58>, <acme.bar.bar_plugin.BarPlugin object at 0x1112cfeb8>, <acme.baz.baz_plugin.BazPlugin object at 0x1112cfdb0>]>
plugin acme.foo starting
plugin acme.foo started
plugin acme.bar starting
plugin acme.bar started
plugin acme.baz starting
plugin acme.baz started
plugin acme.baz stopping
plugin acme.baz stopped
plugin acme.bar stopping
plugin acme.bar stopped
plugin acme.foo stopping
plugin acme.foo stopped
ok
include specific ... egg plugin manager found plugins <[<acme.foo.foo_plugin.FooPlugin object at 0x111155150>, <acme.bar.bar_plugin.BarPlugin object at 0x111155780>]>
plugin acme.foo starting
plugin acme.foo started
plugin acme.bar starting
plugin acme.bar started
plugin acme.bar stopping
plugin acme.bar stopped
plugin acme.foo stopping
plugin acme.foo stopped
ok
no include or exclude ... egg plugin manager found plugins <[<acme.foo.foo_plugin.FooPlugin object at 0x111155150>, <acme.bar.bar_plugin.BarPlugin object at 0x111155048>, <acme.baz.baz_plugin.BazPlugin object at 0x1112cfd58>, <envisage.core_plugin.CorePlugin object at 0x111155780>]>
ok
explicit extension registry ... extension point <my.ep> added
ok
set extensions via registry ... extension point <my.ep> added
ok
set extensions via trait ... extension point <my.ep> added
ok
test_should_be_able_to_bind_multiple_traits_on_a_single_object (envisage.tests.extension_point_binding_test_case.ExtensionPointBindingTestCase) ... extension point <my.ep> added
extension point <another.ep> added
ok
untyped extension point ... extension point <my.ep> added
ok
add plugin ... ---------- application starting ----------
plugin A starting
plugin A started
plugin B starting
plugin B started
---------- application started ----------
extensions to <a.x> <[[], [1, 2, 3]]>
ok
append ... ---------- application starting ----------
plugin A starting
plugin A started
plugin B starting
plugin B started
plugin C starting
plugin C started
---------- application started ----------
extensions to <a.x> <[[], [1, 2, 3], [98, 99, 100]]>
provider <<envisage.tests.application_test_case.PluginB object at 0x1111551a8>> extension point changed
ok
assign empty list ... ---------- application starting ----------
plugin A starting
plugin A started
plugin B starting
plugin B started
plugin C starting
plugin C started
---------- application started ----------
extensions to <a.x> <[[], [1, 2, 3], [98, 99, 100]]>
provider <<envisage.tests.application_test_case.PluginB object at 0x111223200>> extension point changed
ok
assign empty list no event ... ---------- application starting ----------
plugin A starting
plugin A started
plugin B starting
plugin B started
plugin C starting
plugin C started
---------- application started ----------
provider <<envisage.tests.application_test_case.PluginB object at 0x1112237d8>> extension point changed
extensions to <a.x> <[[], [], [98, 99, 100]]>
ok
assign non-empty list ... ---------- application starting ----------
plugin A starting
plugin A started
plugin B starting
plugin B started
plugin C starting
plugin C started
---------- application started ----------
extensions to <a.x> <[[], [1, 2, 3], [98, 99, 100]]>
provider <<envisage.tests.application_test_case.PluginB object at 0x111223e60>> extension point changed
ok
remove ... ---------- application starting ----------
plugin A starting
plugin A started
plugin B starting
plugin B started
plugin C starting
plugin C started
---------- application started ----------
extensions to <a.x> <[[], [1, 2, 3], [98, 99, 100]]>
provider <<envisage.tests.application_test_case.PluginB object at 0x11122f3b8>> extension point changed
ok
remove plugin ... ---------- application starting ----------
plugin A starting
plugin A started
plugin B starting
plugin B started
plugin C starting
plugin C started
---------- application started ----------
extensions to <a.x> <[[], [1, 2, 3], [98, 99, 100]]>
ok
set extension point ... ---------- application starting ----------
plugin A starting
plugin A started
---------- application started ----------
ok
extension point changed ... extension point <my.ep> added
ok
extension point with no Id ... ok
invalid extension point ... extension point <my.ep> added
ok
invalid extension point type ... ok
no reference to extension registry ... extension point <my.ep> added
ok
set typed extension point ... extension point <my.ep> added
ok
set untyped extension point ... extension point <my.ep> added
ok
typed extension point ... extension point <my.ep> added
ok
untyped extension point ... extension point <my.ep> added
ok
add extension point ... extension point <my.ep> added
ok
empty registry ... ok
get extension point ... extension point <my.ep> added
ok
remove empty_extension point ... extension point <my.ep> added
extension point <my.ep> removed
ok
remove non-empty extension point ... extension point <my.ep> added
extension point <my.ep> removed
ok
remove non existent extension point ... ok
remove non existent listener ... ok
set extensions ... extension point <my.ep> added
ok
import dotted module ... ok
import dotted symbol ... ok
import nested symbol ... ok
test_find_plugins_in_packages_on_the_plugin_path (envisage.tests.package_plugin_manager_test_case.PackagePluginManagerTestCase) ... Looking for plugins in /Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/tests/plugins/pear
package plugin manager found plugins <[<pear.pear_plugin.PearPlugin object at 0x1112cfd00>, <banana.banana_plugin.BananaPlugin object at 0x1112cffc0>, <orange.orange_plugin.OrangePlugin object at 0x11127c9e8>]>
ok
test_ignore_plugins_matching_a_wildcard_in_the_exclude_list (envisage.tests.package_plugin_manager_test_case.PackagePluginManagerTestCase) ... Looking for plugins in /Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/tests/plugins/pear
package plugin manager found plugins <[<banana.banana_plugin.BananaPlugin object at 0x11127ca40>]>
plugin banana starting
plugin banana started
plugin banana stopping
plugin banana stopped
ok
test_ignore_plugins_whose_ids_are_in_the_exclude_list (envisage.tests.package_plugin_manager_test_case.PackagePluginManagerTestCase) ... Looking for plugins in /Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/tests/plugins/pear
package plugin manager found plugins <[<banana.banana_plugin.BananaPlugin object at 0x11127c4c0>]>
plugin banana starting
plugin banana started
plugin banana stopping
plugin banana stopped
ok
test_only_find_plugins_matching_a_wildcard_in_the_include_list (envisage.tests.package_plugin_manager_test_case.PackagePluginManagerTestCase) ... Looking for plugins in /Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/tests/plugins/pear
package plugin manager found plugins <[<pear.pear_plugin.PearPlugin object at 0x1112cffc0>, <orange.orange_plugin.OrangePlugin object at 0x11127c360>]>
plugin pear starting
plugin pear started
plugin orange starting
plugin orange started
plugin orange stopping
plugin orange stopped
plugin pear stopping
plugin pear stopped
ok
test_only_find_plugins_whose_ids_are_in_the_include_list (envisage.tests.package_plugin_manager_test_case.PackagePluginManagerTestCase) ... Looking for plugins in /Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/tests/plugins/pear
package plugin manager found plugins <[<pear.pear_plugin.PearPlugin object at 0x1112cffc0>, <orange.orange_plugin.OrangePlugin object at 0x11127ca40>]>
plugin pear starting
plugin pear started
plugin orange starting
plugin orange started
plugin orange stopping
plugin orange stopped
plugin pear stopping
plugin pear stopped
ok
test_reflect_changes_to_the_plugin_path (envisage.tests.package_plugin_manager_test_case.PackagePluginManagerTestCase) ... package plugin manager found plugins <[]>
Looking for plugins in /Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/tests/plugins/pear
package plugin manager found plugins <[<pear.pear_plugin.PearPlugin object at 0x1112cffc0>, <banana.banana_plugin.BananaPlugin object at 0x11127c9e8>, <orange.orange_plugin.OrangePlugin object at 0x11127c4c0>]>
package plugin manager found plugins <[]>
ok
get plugin ... plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x1112cfd00> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
ok
test_ignore_plugins_matching_a_wildcard_in_the_exclude_list (envisage.tests.plugin_manager_test_case.PluginManagerTestCase) ... plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x1112cfd00> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x1112cffc0> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x11127ca40> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin foo starting
plugin foo started
plugin bar starting
plugin bar started
plugin baz starting
plugin baz started
plugin baz stopping
plugin baz stopped
plugin bar stopping
plugin bar stopped
plugin foo stopping
plugin foo stopped
ok
test_ignore_plugins_whose_ids_are_in_the_exclude_list (envisage.tests.plugin_manager_test_case.PluginManagerTestCase) ... plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x1112cfd00> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x1112cffc0> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x11127c9e8> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin foo starting
plugin foo started
plugin bar starting
plugin bar started
plugin baz starting
plugin baz started
plugin baz stopping
plugin baz stopped
plugin bar stopping
plugin bar stopped
plugin foo stopping
plugin foo stopped
ok
iteration over plugins ... plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x1112cfd00> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin <envisage.tests.plugin_manager_test_case.BadPlugin object at 0x1112cffc0> has no Id - using <envisage.tests.plugin_manager_test_case.BadPlugin>
ok
test_only_include_plugins_matching_a_wildcard_in_the_include_list (envisage.tests.plugin_manager_test_case.PluginManagerTestCase) ... plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x1112cffc0> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x1112cfd00> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x11127ca40> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin foo starting
plugin foo started
plugin bar starting
plugin bar started
plugin baz starting
plugin baz started
plugin baz stopping
plugin baz stopped
plugin bar stopping
plugin bar stopped
plugin foo stopping
plugin foo stopped
ok
test_only_include_plugins_whose_ids_are_in_the_include_list (envisage.tests.plugin_manager_test_case.PluginManagerTestCase) ... plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x1112cffc0> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x1112cfd00> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x11127c9e8> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin foo starting
plugin foo started
plugin bar starting
plugin bar started
plugin baz starting
plugin baz started
plugin baz stopping
plugin baz stopped
plugin bar stopping
plugin bar stopped
plugin foo stopping
plugin foo stopped
ok
start and stop ... plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x1112cffc0> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin envisage.tests.plugin_manager_test_case.SimplePlugin starting
plugin envisage.tests.plugin_manager_test_case.SimplePlugin started
plugin envisage.tests.plugin_manager_test_case.SimplePlugin stopping
plugin envisage.tests.plugin_manager_test_case.SimplePlugin stopped
ok
start and stop errors ... plugin <envisage.tests.plugin_manager_test_case.SimplePlugin object at 0x1112cfd00> has no Id - using <envisage.tests.plugin_manager_test_case.SimplePlugin>
plugin envisage.tests.plugin_manager_test_case.SimplePlugin starting
plugin envisage.tests.plugin_manager_test_case.SimplePlugin started
plugin <envisage.tests.plugin_manager_test_case.BadPlugin object at 0x1112cffc0> has no Id - using <envisage.tests.plugin_manager_test_case.BadPlugin>
plugin envisage.tests.plugin_manager_test_case.BadPlugin starting
plugin envisage.tests.plugin_manager_test_case.BadPlugin stopping
ok
add plugins to empty application ... ---------- application starting ----------
---------- application started ----------
plugin A starting
plugin A started
extensions to <x> <[[]]>
ok
contributes to ... extensions to <x> <[[], [1, 2, 3]]>
ok
contributes to decorator ... extensions to <x> <[[], [1, 2, 3]]>
ok
contributes to decorator ignored if trait present ... extensions to <x> <[[], [1, 2, 3]]>
ok
exception in trait contribution ... getting extensions from <envisage.tests.plugin_test_case.PluginTestCase.test_exception_in_trait_contribution.<locals>.PluginB object at 0x11127ceb8>, trait <x>
Traceback (most recent call last):
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugin.py", line 334, in _get_extensions_from_trait
    extensions = getattr(self, trait_name)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/tests/plugin_test_case.py", line 251, in _x_default
    raise 1/0
ZeroDivisionError: division by zero
ok
home ... ok
id policy ... plugin <envisage.plugin.Plugin object at 0x1112b26d0> has no Id - using <envisage.plugin.Plugin>
plugin <envisage.plugin.Plugin object at 0x1112b2780> has no Id - using <envisage.plugin.Plugin>
plugin <envisage.plugin.Plugin object at 0x1112b26d0> has no name - using <Plugin>
plugin <envisage.plugin.Plugin object at 0x1112b26d0> has no Id - using <envisage.plugin.Plugin>
ok
multiple trait contributions ... ok
name policy ... plugin <envisage.plugin.Plugin object at 0x11120b6d0> has no name - using <Plugin>
plugin <envisage.plugin.Plugin object at 0x111155048> has no name - using <Plugin>
plugin <envisage.tests.plugin_test_case.PluginTestCase.test_name_policy.<locals>.ThisIsMyPlugin object at 0x1112ac990> has no name - using <This Is My Plugin>
ok
plugin activator. ... ---------- application starting ----------
plugin A starting
plugin A started
plugin B starting
plugin B started
---------- application started ----------
---------- application stopping ----------
plugin B stopping
plugin B stopped
plugin A stopping
plugin A stopped
loading preferences from </Users/mdickinson/.enthought/test/preferences.ini>
saving preferences to </Users/mdickinson/.enthought/test/preferences.ini>
---------- application stopped ----------
ok
service ... ---------- application starting ----------
plugin A starting
DEPRECATED: Do not use the "service=True" metadata anymore. Services should now be offered using the service offer extension point (envisage.service_offers) from the core plugin. Plugin <envisage.tests.plugin_test_case.PluginTestCase.test_service.<locals>.PluginA object at 0x1112929e8> trait <bar>
service <1> registered envisage.tests.plugin_test_case.Bar
DEPRECATED: Do not use the "service=True" metadata anymore. Services should now be offered using the service offer extension point (envisage.service_offers) from the core plugin. Plugin <envisage.tests.plugin_test_case.PluginTestCase.test_service.<locals>.PluginA object at 0x1112929e8> trait <baz>
service <2> registered envisage.tests.plugin_test_case.Baz
DEPRECATED: Do not use the "service=True" metadata anymore. Services should now be offered using the service offer extension point (envisage.service_offers) from the core plugin. Plugin <envisage.tests.plugin_test_case.PluginTestCase.test_service.<locals>.PluginA object at 0x1112929e8> trait <foo>
service <3> registered envisage.tests.plugin_test_case.Foo
plugin A started
---------- application started ----------
---------- application stopping ----------
plugin A stopping
service <3> unregistered
service <2> unregistered
service <1> unregistered
plugin A stopped
loading preferences from </Users/mdickinson/.enthought/test/preferences.ini>
saving preferences to </Users/mdickinson/.enthought/test/preferences.ini>
---------- application stopped ----------
ok
service protocol ... ---------- application starting ----------
plugin A starting
DEPRECATED: Do not use the "service=True" metadata anymore. Services should now be offered using the service offer extension point (envisage.service_offers) from the core plugin. Plugin <envisage.tests.plugin_test_case.PluginTestCase.test_service_protocol.<locals>.PluginA object at 0x111292308> trait <foo>
service <1> registered envisage.tests.plugin_test_case.IBar
plugin A started
---------- application started ----------
---------- application stopping ----------
plugin A stopping
service <1> unregistered
plugin A stopped
loading preferences from </Users/mdickinson/.enthought/test/preferences.ini>
saving preferences to </Users/mdickinson/.enthought/test/preferences.ini>
---------- application stopped ----------
ok
add extension point ... extension point <my.ep> added
ok
empty registry ... ok
get extension point ... extension point <my.ep> added
ok
remove empty_extension point ... extension point <my.ep> added
extension point <my.ep> removed
ok
remove non-empty extension point ... extension point <my.ep> added
extension point <my.ep> removed
ok
remove non existent extension point ... ok
remove non existent listener ... ok
set extensions ... extension point <my.ep> added
ok
add extension point ... extension point <my.ep> added
extensions to <my.ep> <[]>
ok
add provider ... extensions to <x> <[[42]]>
ok
empty registry ... getting extensions of unknown extension point <my.ep>
ok
get extension point ... extension point <my.ep> added
ok
get providers ... ok
provider extensions changed ... extensions to <my.ep> <[[42], [99, 100]]>
provider <<envisage.tests.provider_extension_registry_test_case.ProviderExtensionRegistryTestCase.test_provider_extensions_changed.<locals>.ProviderA object at 0x11138eca8>> extension point changed
provider <<envisage.tests.provider_extension_registry_test_case.ProviderExtensionRegistryTestCase.test_provider_extensions_changed.<locals>.ProviderB object at 0x11138ed00>> extension point changed
provider <<envisage.tests.provider_extension_registry_test_case.ProviderExtensionRegistryTestCase.test_provider_extensions_changed.<locals>.ProviderB object at 0x11138ed00>> extension point changed
ok
providers ... extensions to <x> <[[42, 43], [44, 45, 46], []]>
ok
remove empty_extension point ... extension point <my.ep> added
extension point <my.ep> removed
ok
remove non-empty extension point ... extensions to <x> <[[42, 43]]>
extension point <x> removed
getting extensions of unknown extension point <x>
ok
remove non existent extension point ... ok
remove non existent listener ... ok
remove provider ... ok
remove provider ... extensions to <x> <[[42], [43, 44]]>
getting extensions of unknown extension point <x>
ok
remove provider with no contributions ... extensions to <x> <[[]]>
getting extensions of unknown extension point <x>
ok
set extensions ... extension point <my.ep> added
ok
test_can_create_weakref_to_bound_method (envisage.tests.safeweakref_test_case.SafeWeakrefTestCase) ... ok
test_get_builtin_weakref_for_non_bound_method (envisage.tests.safeweakref_test_case.SafeWeakrefTestCase) ... ok
test_internal_cache_is_weak_too (envisage.tests.safeweakref_test_case.SafeWeakrefTestCase) ... ok
test_two_weakrefs_to_bound_method_are_equal (envisage.tests.safeweakref_test_case.SafeWeakrefTestCase) ... ok
test_two_weakrefs_to_bound_method_are_identical (envisage.tests.safeweakref_test_case.SafeWeakrefTestCase) ... ok
test_two_weakrefs_to_bound_method_hash_equally (envisage.tests.safeweakref_test_case.SafeWeakrefTestCase) ... ok
function service factory ... service <1> registered envisage.tests.service_registry_test_case.IFoo
ok
get and set service properties ... service <1> registered envisage.tests.service_registry_test_case.IFoo
service <2> registered envisage.tests.service_registry_test_case.IFoo
ok
get service ... service <1> registered envisage.tests.service_registry_test_case.IFoo
service <2> registered envisage.tests.service_registry_test_case.IFoo
ok
get service with query ... service <1> registered envisage.tests.service_registry_test_case.IFoo
service <2> registered envisage.tests.service_registry_test_case.IFoo
ok
get services ... service <1> registered envisage.tests.service_registry_test_case.IFoo
service <2> registered envisage.tests.service_registry_test_case.IFoo
ok
get services with query ... service <1> registered envisage.tests.service_registry_test_case.IFoo
service <2> registered envisage.tests.service_registry_test_case.IFoo
ok
get services with strings ... service <1> registered envisage.tests.foo.IFoo
service <2> registered envisage.tests.foo.IFoo
ok
imported service factory ... service <1> registered traits.has_traits.HasTraits
ok
lazy bound method service factory ... service <1> registered envisage.tests.i_foo.IFoo
ok
lazy function service factory ... service <1> registered envisage.tests.i_foo.IFoo
ok
minimize and maximize ... service <1> registered envisage.tests.service_registry_test_case.IFoo
service <2> registered envisage.tests.service_registry_test_case.IFoo
service <3> registered envisage.tests.service_registry_test_case.IFoo
ok
test_should_get_exception_if_required_service_is_missing (envisage.tests.service_registry_test_case.ServiceRegistryTestCase) ... ok
test_should_get_required_service (envisage.tests.service_registry_test_case.ServiceRegistryTestCase) ... service <1> registered envisage.tests.service_registry_test_case.Foo
ok
unregister service ... service <1> registered envisage.tests.service_registry_test_case.IFoo
service <2> registered envisage.tests.service_registry_test_case.IFoo
service <1> unregistered
service <2> unregistered
ok
service trait type ... ---------- application starting ----------
plugin A starting
DEPRECATED: Do not use the "service=True" metadata anymore. Services should now be offered using the service offer extension point (envisage.service_offers) from the core plugin. Plugin <envisage.tests.service_test_case.ServiceTestCase.test_service_trait_type.<locals>.PluginA object at 0x111292780> trait <foo>
service <1> registered envisage.tests.service_test_case.Foo
plugin A started
plugin B starting
plugin B started
---------- application started ----------
---------- application stopping ----------
plugin B stopping
plugin B stopped
plugin A stopping
service <1> unregistered
plugin A stopped
loading preferences from </Users/mdickinson/.enthought/test/preferences.ini>
saving preferences to </Users/mdickinson/.enthought/test/preferences.ini>
---------- application stopped ----------
ok
service trait type with no service registry ... ok
append ... ok
assign extended slice ... ok
assign item ... ok
assign slice ... ok
del all ... ok
del extended slice ... ok
del item ... ok
del slice ... ok
extend ... ok
insert ... ok
remove ... ok
remove ... ok
reverse ... ok
sort ... ok

======================================================================
ERROR: test_initial_namespace (envisage.plugins.ipython_kernel.tests.test_internal_ipkernel.TestInternalIPKernel)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugins/ipython_kernel/tests/test_internal_ipkernel.py", line 48, in test_initial_namespace
    kernel.shutdown()
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 88, in shutdown
    self.ipkernel.shell.exit_now = True
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/traitlets/traitlets.py", line 585, in __set__
    self.set(obj, value)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/traitlets/traitlets.py", line 574, in set
    obj._notify_trait(self.name, old_value, new_value)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/traitlets/traitlets.py", line 1139, in _notify_trait
    type='change',
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/traitlets/traitlets.py", line 1176, in notify_change
    c(change)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/ipykernel/zmqshell.py", line 472, in _update_exit_now
    loop = self.kernel.io_loop
AttributeError: 'IPythonKernel' object has no attribute 'io_loop'

======================================================================
ERROR: test_io_pub_thread_stopped (envisage.plugins.ipython_kernel.tests.test_internal_ipkernel.TestInternalIPKernel)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugins/ipython_kernel/tests/test_internal_ipkernel.py", line 52, in test_io_pub_thread_stopped
    kernel.init_ipkernel(gui_backend=None)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 62, in init_ipkernel
    self.ipkernel = gui_kernel(gui_backend)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 28, in gui_kernel
    kernel.initialize(argv)
  File "<decorator-gen-123>", line 2, in initialize
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 456, in initialize
    self.init_sockets()
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 238, in init_sockets
    self.shell_port = self._bind_socket(self.shell_socket, self.shell_port)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 180, in _bind_socket
    s.bind("tcp://%s:%i" % (self.ip, port))
  File "zmq/backend/cython/socket.pyx", line 547, in zmq.backend.cython.socket.Socket.bind
  File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc
zmq.error.ZMQError: Address already in use

======================================================================
ERROR: test_lifecycle (envisage.plugins.ipython_kernel.tests.test_internal_ipkernel.TestInternalIPKernel)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugins/ipython_kernel/tests/test_internal_ipkernel.py", line 31, in test_lifecycle
    kernel.init_ipkernel(gui_backend=None)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 62, in init_ipkernel
    self.ipkernel = gui_kernel(gui_backend)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 28, in gui_kernel
    kernel.initialize(argv)
  File "<decorator-gen-123>", line 2, in initialize
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 456, in initialize
    self.init_sockets()
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 238, in init_sockets
    self.shell_port = self._bind_socket(self.shell_socket, self.shell_port)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 180, in _bind_socket
    s.bind("tcp://%s:%i" % (self.ip, port))
  File "zmq/backend/cython/socket.pyx", line 547, in zmq.backend.cython.socket.Socket.bind
  File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc
zmq.error.ZMQError: Address already in use

======================================================================
ERROR: test_kernel_namespace_extension_point (envisage.plugins.ipython_kernel.tests.test_ipython_kernel_plugin.TestIPythonKernelPlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugins/ipython_kernel/tests/test_ipython_kernel_plugin.py", line 72, in test_kernel_namespace_extension_point
    kernel.init_ipkernel(gui_backend=None)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 62, in init_ipkernel
    self.ipkernel = gui_kernel(gui_backend)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 28, in gui_kernel
    kernel.initialize(argv)
  File "<decorator-gen-123>", line 2, in initialize
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 456, in initialize
    self.init_sockets()
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 238, in init_sockets
    self.shell_port = self._bind_socket(self.shell_socket, self.shell_port)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 180, in _bind_socket
    s.bind("tcp://%s:%i" % (self.ip, port))
  File "zmq/backend/cython/socket.pyx", line 547, in zmq.backend.cython.socket.Socket.bind
  File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc
zmq.error.ZMQError: Address already in use

======================================================================
ERROR: test_kernel_service (envisage.plugins.ipython_kernel.tests.test_ipython_kernel_plugin.TestIPythonKernelPlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugins/ipython_kernel/tests/test_ipython_kernel_plugin.py", line 53, in test_kernel_service
    kernel.init_ipkernel(gui_backend=None)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 62, in init_ipkernel
    self.ipkernel = gui_kernel(gui_backend)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/envisage-4.7.0.dev41-py3.5.egg/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 28, in gui_kernel
    kernel.initialize(argv)
  File "<decorator-gen-123>", line 2, in initialize
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 456, in initialize
    self.init_sockets()
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 238, in init_sockets
    self.shell_port = self._bind_socket(self.shell_socket, self.shell_port)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.5-null/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 180, in _bind_socket
    s.bind("tcp://%s:%i" % (self.ip, port))
  File "zmq/backend/cython/socket.pyx", line 547, in zmq.backend.cython.socket.Socket.bind
  File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc
zmq.error.ZMQError: Address already in use

----------------------------------------------------------------------
Ran 198 tests in 3.324s

FAILED (errors=5)
Command '['edm', 'run', '-e', 'envisage-test-3.5-null', '--', 'coverage', 'run', '-p', '-m', 'nose.core', '-v', 'envisage', '--nologcapture']' returned non-zero exit status 1.
taniyama:envisage mdickinson$ 

@mdickinson
Copy link
Member Author

ipykernel is now at 4.7.0 in EDM, so our CI is failing on master. This is critical to fix.

@dpinte
Copy link
Member

dpinte commented Nov 13, 2018

@mdickinson seems related to ipython/ipykernel#319

@mdickinson
Copy link
Member Author

Also possibly related to jupyter-server/kernel_gateway#131

@mdickinson
Copy link
Member Author

Attempting to pick this up again. I'm currently investigating this single test failure, and I'll go on from there.

mirzakhani:envisage mdickinson$ edm run -e envisage-test-3.6-null -- python -m unittest envisage.plugins.ipython_kernel.tests.test_ipython_kernel_plugin.TestIPythonKernelPlugin.test_kernel_namespace_extension_point
/Users/mdickinson/Enthought/ETS/envisage/envisage/plugin.py:181: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
  logger.warn('plugin %s has no Id - using <%s>' % (self, id))
NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.

To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.

To read more about this, see https://github.com/ipython/ipython/issues/2049


To connect another client to this kernel, use:
    --existing kernel-57772.json
E
======================================================================
ERROR: test_kernel_namespace_extension_point (envisage.plugins.ipython_kernel.tests.test_ipython_kernel_plugin.TestIPythonKernelPlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/mdickinson/Enthought/ETS/envisage/envisage/plugins/ipython_kernel/tests/test_ipython_kernel_plugin.py", line 76, in test_kernel_namespace_extension_point
    app.stop()
  File "/Users/mdickinson/Enthought/ETS/envisage/envisage/application.py", line 330, in stop
    self.plugin_manager.stop()
  File "/Users/mdickinson/Enthought/ETS/envisage/envisage/plugin_manager.py", line 164, in stop
    self.stop_plugin(plugin)
  File "/Users/mdickinson/Enthought/ETS/envisage/envisage/plugin_manager.py", line 174, in stop_plugin
    plugin.activator.stop_plugin(plugin)
  File "/Users/mdickinson/Enthought/ETS/envisage/envisage/plugin_activator.py", line 38, in stop_plugin
    plugin.stop()
  File "/Users/mdickinson/Enthought/ETS/envisage/envisage/plugins/ipython_kernel/ipython_kernel_plugin.py", line 34, in stop
    self.kernel.shutdown()
  File "/Users/mdickinson/Enthought/ETS/envisage/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 88, in shutdown
    self.ipkernel.shell.exit_now = True
  File "/Users/mdickinson/.edm/envs/envisage-test-3.6-null/lib/python3.6/site-packages/traitlets/traitlets.py", line 585, in __set__
    self.set(obj, value)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.6-null/lib/python3.6/site-packages/traitlets/traitlets.py", line 574, in set
    obj._notify_trait(self.name, old_value, new_value)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.6-null/lib/python3.6/site-packages/traitlets/traitlets.py", line 1139, in _notify_trait
    type='change',
  File "/Users/mdickinson/.edm/envs/envisage-test-3.6-null/lib/python3.6/site-packages/traitlets/traitlets.py", line 1176, in notify_change
    c(change)
  File "/Users/mdickinson/.edm/envs/envisage-test-3.6-null/lib/python3.6/site-packages/ipykernel/zmqshell.py", line 472, in _update_exit_now
    loop = self.kernel.io_loop
AttributeError: 'IPythonKernel' object has no attribute 'io_loop'

----------------------------------------------------------------------
Ran 1 test in 0.094s

FAILED (errors=1)

@mdickinson
Copy link
Member Author

Digging into this: we're hitting this in the _update_exit_now method of the ZMQInteractiveShell, which is reacting to the exit_now traitlet (Bool type), inherited from the parent class IPython.core.InteractiveShell.

    @observe('exit_now')
    def _update_exit_now(self, change):
        """stop eventloop when exit_now fires"""
        if change['new']:
            loop = self.kernel.io_loop
            loop.call_later(0.1, loop.stop)

The previous implementation of this method, from ipykernel 4.6.1, looked like this:

    @observe('exit_now')
    def _update_exit_now(self, change):
        """stop eventloop when exit_now fires"""
        if change['new']:
            loop = ioloop.IOLoop.instance()
            loop.add_timeout(time.time() + 0.1, loop.stop)

Here self.kernel has type ipykernel.ipkernel.IPythonKernel. That class inherits from ipykernel.kernelbase.Kernel, which sets the io_loop attribute in its start method. That method is never being called, and that in turn is because the IPKernelApp initialises the kernel (in its init_kernel) but doesn't start it (the IPKernelApp.start method is never called).

Possible workarounds: (1) make sure we actually start the kernel in the test. This would better match the behaviour of the app. (2) monkey-patch the ZMQInteractiveShell to check whether the kernel was started before trying to stop it. (3) magic option 3.

@dpinte
Copy link
Member

dpinte commented Jan 25, 2019

I have all the test passing by adding the following in the InternalIPKernel.init_ipkernel method :

           # Since ipykernel 4.7, the io_loop attribute of the kernel is not initialized anymore
           # Workaround: Retrieve the kernel on the IPykernelApp and set the io_loop without starting it! 
            if not hasattr(self.ipkernel.kernel, 'io_loop'):
                self.ipkernel.kernel.io_loop = ioloop.IOLoop.instance()

@mdickinson how do you feel with this?

@mdickinson
Copy link
Member Author

If it gets all the tests passing, let's do it. I'm reasonably convinced from previous investigations that the failures don't represent a real issue with the actual app.

@dpinte
Copy link
Member

dpinte commented Jan 25, 2019

@mdickinson happy, happy, test suite passes nicely now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants