Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5a6bdd0

Browse filesBrowse files
Trottaddaleax
authored andcommitted
test: improve assertions in pummel/test-timers
* Timers should not fire early. Check for that. * Allow the wiggle-room to increase on subsequent iterations of intervals. PR-URL: #35216 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
1 parent 1018e52 commit 5a6bdd0
Copy full SHA for 5a6bdd0

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎test/pummel/test-timers.js‎

Copy file name to clipboardExpand all lines: test/pummel/test-timers.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const WINDOW = 200; // Why does this need to be so big?
3636
assert.ok(diff > 0);
3737
console.error(`diff: ${diff}`);
3838

39-
assert.strictEqual(1000 - WINDOW < diff && diff < 1000 + WINDOW, true);
39+
assert.ok(1000 <= diff && diff < 1000 + WINDOW);
4040
}), 1000);
4141
}
4242

@@ -61,7 +61,7 @@ const WINDOW = 200; // Why does this need to be so big?
6161

6262
const t = interval_count * 1000;
6363

64-
assert.ok(t - WINDOW < diff && diff < t + WINDOW, `t: ${t}`);
64+
assert.ok(t <= diff && diff < t + (WINDOW * interval_count));
6565

6666
assert.ok(interval_count <= 3, `interval_count: ${interval_count}`);
6767
if (interval_count === 3)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.