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: fix flaky test-regress-GH-897 · italoacasas/node@9d5170f

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 clipboard
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 before timers set
6+
// with values greater than 1ms.
7+
//
8+
// Ref: https://github.com/nodejs/node-v0.x-archive/pull/897
9+
10+
const common = require('../common');
11+
12+
let timer;
13+
14+
setTimeout(function() {
15+
clearTimeout(timer);
16+
}, 0.1); // 0.1 should be treated the same as 1, not 1000...
17+
18+
timer = setTimeout(function() {
19+
common.fail('timers fired out of order');
20+
}, 2); // ...so this timer should fire second.
Collapse file

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

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

0 commit comments

Comments
0 (0)
You are visitor 01402605 — 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.