Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/test/simple/test-timers-unref-active.js b/test/simple/test-timers-unref-active.js
index 851ef1c..ce07c2d 100644
--- a/test/simple/test-timers-unref-active.js
+++ b/test/simple/test-timers-unref-active.js
@@ -40,7 +40,16 @@ var assert = require('assert');
var someObject = {};
var nbTimeouts = 0;
-var N = 10;
+/*
+ * libuv 0.10.x uses GetTickCount on Windows to implement timers, which uses
+ * system's timers whose resolution is between 10 and 16ms. See
+ * http://msdn.microsoft.com/en-us/library/windows/desktop/ms724408.aspx
+ * for more information. That's the lowest resolution for timers across all
+ * supported platforms. We're using it as the lowest common denominator,
+ * and thus expect 5 timers to be able to fire in under 100 ms.
+ */
+var N = 5;
+var TEST_DURATION = 100;
timers.unenroll(someObject);
timers.enroll(someObject, 1);
@@ -59,4 +68,4 @@ startTimer();
setTimeout(function() {
assert.equal(nbTimeouts, N);
-}, 100);
+}, TEST_DURATION);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.