Skip to content

Commit

Permalink
test: Fix flaky test-vm-timeout-rethrow
Browse files Browse the repository at this point in the history
The intention of test case is to make sure that `timeout` property is honored
and the code in context terminates and throws correct exception. However in
test case, the code inside context would complete before `timeout` for windows
and would sometimes fail. Updated the code so it guarantee to not complete
execution until timeout is triggered.

Fixes: nodejs#11261
  • Loading branch information
kunalspathak committed Feb 24, 2017
1 parent d42296b commit 247d487
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/sequential/test-vm-timeout-rethrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const spawn = require('child_process').spawn;

if (process.argv[2] === 'child') {
const code = 'let j = 0;\n' +
'for (let i = 0; i < 1000000; i++) j += add(i, i + 1);\n' +
'while(true);\n' +
'j;';

const ctx = vm.createContext({
Expand Down

0 comments on commit 247d487

Please sign in to comment.