GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: move timer-dependent test to sequential · nodejs/node@b2b2bc2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test
    • parallel
      • test-regress-GH-897.js
    • sequential
      • test-regress-GH-897.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-regress-GH-897.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-regress-GH-897.js
-15Lines changed: 0 additions & 15 deletions
This file was deleted.
Collapse file

‎test/sequential/test-regress-GH-897.js‎

Copy file name to clipboard
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use strict';
2+
3+
// Test for bug where a timer duration greater than 0 ms but less than 1 ms
4+
// resulted in the duration being set for 1000 ms. The expected behavior is
5+
// that the timeout would be set for 1 ms, and thus fire more-or-less
6+
// immediately.
7+
//
8+
// Ref: https://github.com/nodejs/node-v0.x-archive/pull/897
9+
10+
const common = require('../common');
11+
const assert = require('assert');
12+
13+
const t = Date.now();
14+
setTimeout(common.mustCall(function() {
15+
const diff = Date.now() - t;
16+
assert.ok(diff < 100, `timer fired after ${diff} ms`);
17+
}), 0.1);

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.