yet another JS race condition fix

this should greatly reduce the number of timeouts seen in the JS tests
This commit is contained in:
Paul Ivanov 2013-11-01 19:10:45 -07:00
parent c4b9e69793
commit 2ab51dc1a5
2 changed files with 15 additions and 1 deletions

View File

@ -4,10 +4,20 @@
casper.notebook_test(function () {
this.evaluate(function () {
var cell = IPython.notebook.get_cell(0);
cell.set_text('import time\nfor x in range(3):\n time.sleep(1)');
cell.set_text(
'import time'+
'\nfor x in range(3):'+
'\n time.sleep(1)'
);
cell.execute();
});
this.waitFor(function(){
return this.evaluate(function() {
return $("#notification_kernel")[0].textContent.indexOf('busy') !== -1;
});
});
// interrupt using menu item (Kernel -> Interrupt)
this.thenClick('li#int_kernel');

View File

@ -67,6 +67,10 @@ casper.wait_for_output = function (cell_num) {
},
// pass parameter from the test suite js to the browser code js
{c : cell_num});
},
function then() { },
function timeout() {
this.echo("wait_for_output timedout!");
});
});
};