Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix flaky test-regress-GH-897 #10903

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions test/parallel/test-regress-GH-897.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';

// Test for bug where a timer duration greater than 0 ms but less than 1 ms
// resulted in the duration being set for 1000 ms. The expected behavior is
// that the timeout would be set for 1 ms, and thus fire before timers set
// with values greater than 1ms.
//
// Ref: https://github.com/nodejs/node-v0.x-archive/pull/897

const common = require('../common');

let timer;

setTimeout(function() {
clearTimeout(timer);
}, 0.1); // 0.1 should be treated the same as 1, not 1000...

timer = setTimeout(function() {
common.fail('timers fired out of order');
}, 2); // ...so this timer should fire second.
17 changes: 0 additions & 17 deletions test/sequential/test-regress-GH-897.js

This file was deleted.