Let timer test retry for 20ms to reduce flakiness.

BUG=
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/24484003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16948 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 9c455ab7
...@@ -27,9 +27,20 @@ ...@@ -27,9 +27,20 @@
// Tests timer milliseconds granularity. // Tests timer milliseconds granularity.
var start = Date.now(); (function run() {
var end = Date.now(); var start_test = Date.now();
while (end - start == 0) { // Let the retry run for maximum 20ms to reduce flakiness.
end = Date.now(); for (var start = Date.now(); start - start_test < 100; start = Date.now()) {
} var end = Date.now();
assertTrue(end - start <= 2); 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);
})()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment