Skip to content

Commit

Permalink
fix remote setInterval flake (#12263)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Mar 14, 2018
1 parent e7181eb commit 9ed9885
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/node-spec.js
Expand Up @@ -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()
}
Expand Down

0 comments on commit 9ed9885

Please sign in to comment.