Revision: 16948
Author: [email protected]
Date: Wed Sep 25 16:47:56 2013 UTC
Log: Let timer test retry for 20ms to reduce flakiness.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/24484003
http://code.google.com/p/v8/source/detail?r=16948
Modified:
/branches/bleeding_edge/test/mjsunit/timer.js
=======================================
--- /branches/bleeding_edge/test/mjsunit/timer.js Wed Sep 25 09:50:48 2013
UTC
+++ /branches/bleeding_edge/test/mjsunit/timer.js Wed Sep 25 16:47:56 2013
UTC
@@ -27,9 +27,20 @@
// Tests timer milliseconds granularity.
-var start = Date.now();
-var end = Date.now();
-while (end - start == 0) {
- end = Date.now();
-}
-assertTrue(end - start <= 2);
+(function run() {
+ var start_test = Date.now();
+ // Let the retry run for maximum 20ms to reduce flakiness.
+ for (var start = Date.now(); start - start_test < 100; start =
Date.now()) {
+ var end = Date.now();
+ while (end - start == 0) {
+ end = Date.now();
+ }
+ if (end - start == 1) {
+ // Found milliseconds granularity.
+ return;
+ } else {
+ print("Timer difference too big: " + (end - start) + "ms");
+ }
+ }
+ assertTrue(false);
+})()
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.