Skip to content

Commit

Permalink
test: remove unnecessary timer
Browse files Browse the repository at this point in the history
The timer in NAPI's test_callback_scope/test-resolve-async.js
can be removed. If the test fails, it will timeout on its own.
The extra timer increases the chances of the test being
flaky.

PR-URL: nodejs#18719
Fixes: nodejs#18702
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
cjihrig authored and Gabriel Schulhof committed Apr 12, 2018
1 parent 5ab4d31 commit a1df466
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions test/addons-napi/test_callback_scope/test-resolve-async.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
'use strict';

const common = require('../../common');
const assert = require('assert');
const { testResolveAsync } = require(`./build/${common.buildType}/binding`);

let called = false;
testResolveAsync().then(common.mustCall(() => {
called = true;
}));

setTimeout(common.mustCall(() => { assert(called); }),
common.platformTimeout(20));
testResolveAsync().then(common.mustCall());

0 comments on commit a1df466

Please sign in to comment.