mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
yet another JS race condition fix
this should greatly reduce the number of timeouts seen in the JS tests
This commit is contained in:
parent
c4b9e69793
commit
2ab51dc1a5
@ -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');
|
||||
|
@ -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!");
|
||||
});
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user