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

reuse more kernels in kernel tests #4149

Merged
merged 5 commits into from Sep 6, 2013
Merged

Conversation

minrk
Copy link
Member

@minrk minrk commented Aug 30, 2013

move scattered kernel-test utilities to kernel.tests.utils

context managers and tools for starting kernels, and sharing a single global kernel for many tests.

reduce the number of kernels started for IPython.kernel tests, which should save some time.

@minrk
Copy link
Member Author

minrk commented Aug 30, 2013

on my machine, these changes take iptest IPython.kernel from 45 seconds to 20.

@ivanov
Copy link
Member

ivanov commented Aug 30, 2013

confirming the improvement - on my machine, this takes the 38 tests that run on master which take 34 seconds to run, to doing 655 tests which take 17 seconds to run. Just going to look over the code now before merging

@takluyver
Copy link
Member

This is based on Min's restoration of nosepatch in #4148, which has been superseded by my work in #4150. So hold off on merging it until that has been merged and Min has rebased onto it.

@minrk
Copy link
Member Author

minrk commented Sep 3, 2013

Now rebased on #4165.

@@ -171,7 +171,7 @@ def signal_kernel(self, kernel_id, signum):
self.log.info("Signaled Kernel %s with %s" % (kernel_id, signum))

@kernel_method
def restart_kernel(self, kernel_id):
def restart_kernel(self, kernel_id, now=False):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change just for API consistency with another part? Should the extra parameter be described in the docstring?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is for API consistency - all MKM methods should be identical to KM methods, adding a leading kernel_id arg.

context managers and tools for starting kernels,
and sharing a *single* global kernel for many tests.

reduce the number of kernels started for IPython.kernel tests,
which should save some time.
kc = km.client()
kc.start_channels()

msg_id = kc.kernel_info()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is never used - is that deliberate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, there's no need to use it. I could validate the subsequent call with it, but I don't think it's necessary.

@takluyver
Copy link
Member

Looks good.

@takluyver
Copy link
Member

OK, I'm happy with that. Should @ivanov or anyone else look over this?

@ivanov
Copy link
Member

ivanov commented Sep 6, 2013

I just noticed that the test suite in master is still not as fast as it was when i first made the --fast PR, and it's because this hasn't been merged yet, so merging this now.

@minrk
Copy link
Member Author

minrk commented Sep 6, 2013

yay!

ivanov added a commit that referenced this pull request Sep 6, 2013
reuse more kernels in kernel tests
@ivanov ivanov merged commit cd4bd81 into ipython:master Sep 6, 2013
@minrk minrk deleted the fewer-kernels branch September 6, 2013 18:16
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
reuse more kernels in kernel tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants