diff --git a/IPython/html/static/services/kernels/js/kernel.js b/IPython/html/static/services/kernels/js/kernel.js index 77d1fd5..9dde6d6 100644 --- a/IPython/html/static/services/kernels/js/kernel.js +++ b/IPython/html/static/services/kernels/js/kernel.js @@ -249,7 +249,11 @@ define([ var that = this; var on_success = function (data, status, xhr) { - that.kernel_info(); // get kernel info so we know what state the kernel is in + that.events.trigger('status_busy.Kernel', {kernel: this}); + // get kernel info so we know what state the kernel is in + that.kernel_info(function () { + that.events.trigger('status_idle.Kernel', {kernel: this}); + }); if (success) { success(data, status, xhr); } @@ -380,7 +384,12 @@ define([ */ Kernel.prototype._kernel_connected = function () { this.events.trigger('status_connected.Kernel', {kernel: this}); - this.kernel_info(); // get kernel info so we know what state the kernel is in + this.events.trigger('status_busy.Kernel', {kernel: this}); + // get kernel info so we know what state the kernel is in + var that = this; + this.kernel_info(function () { + that.events.trigger('status_idle.Kernel', {kernel: this}); + }); }; /** diff --git a/IPython/html/tests/services/kernel.js b/IPython/html/tests/services/kernel.js index b2f4c06..f11296a 100644 --- a/IPython/html/tests/services/kernel.js +++ b/IPython/html/tests/services/kernel.js @@ -197,7 +197,11 @@ casper.notebook_test(function () { 'status_killed.Kernel', 'kernel_started.Kernel', 'status_connected.Kernel', - 'status_starting.Kernel', + // technically we should get this message, but sometimes the kernel + // finishes starting before we connect to it so then we don't receive + // this message + // + //'status_starting.Kernel', 'status_busy.Kernel', 'status_idle.Kernel' ], @@ -240,7 +244,11 @@ casper.notebook_test(function () { 'status_restarting.Kernel', 'kernel_started.Kernel', 'status_connected.Kernel', - 'status_starting.Kernel', + // technically we should get this message, but sometimes the kernel + // finishes starting before we connect to it so then we don't receive + // this message + // + //'status_starting.Kernel', 'status_busy.Kernel', 'status_idle.Kernel' ], diff --git a/IPython/html/tests/services/session.js b/IPython/html/tests/services/session.js index 44df0c2..60bfbf6 100644 --- a/IPython/html/tests/services/session.js +++ b/IPython/html/tests/services/session.js @@ -104,7 +104,11 @@ casper.notebook_test(function () { [ 'kernel_started.Session', 'status_connected.Kernel', - 'status_starting.Kernel', + // technically we should get this message, but sometimes the kernel + // finishes starting before we connect to it so then we don't receive + // this message + // + //'status_starting.Kernel', 'status_busy.Kernel', 'status_idle.Kernel' ], @@ -135,7 +139,11 @@ casper.notebook_test(function () { 'status_killed.Session', 'kernel_started.Session', 'status_connected.Kernel', - 'status_starting.Kernel', + // technically we should get this message, but sometimes the kernel + // finishes starting before we connect to it so then we don't receive + // this message + // + //'status_starting.Kernel', 'status_busy.Kernel', 'status_idle.Kernel' ],