diff --git a/spec/node-spec.js b/spec/node-spec.js index e4c2655dcb21..f053aa4dbadb 100644 --- a/spec/node-spec.js +++ b/spec/node-spec.js @@ -184,11 +184,15 @@ describe('node feature', () => { describe('setInterval called under Chromium event loop in browser process', () => { it('can be scheduled in time', (done) => { let interval = null + let clearing = false const clear = () => { - if (interval === null) { + if (interval === null || clearing) { return } + // interval might trigger while clearing (remote is slow sometimes) + clearing = true remote.getGlobal('clearInterval')(interval) + clearing = false interval = null done() }