Make intl/overrides/caching.js more 'robust'

Bug: None
Test: intl/overrides/caching
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Iffd0f58f76d6514924badca18a2112df572e53d2
Reviewed-on: https://chromium-review.googlesource.com/757945
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Jungshik Shin <jshin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49334}
This commit is contained in:
Jungshik Shin 2017-11-12 15:45:22 -08:00 committed by Commit Bot
parent bfaa6ef7b8
commit 4091f2b3a8
2 changed files with 4 additions and 6 deletions

View File

@ -26,10 +26,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[
[ALWAYS, {
# TODO(jochen): The following test is flaky.
'overrides/caching': [PASS, FAIL],
}], # ALWAYS
['variant == wasm_traps', {
'*': [SKIP],

View File

@ -53,7 +53,9 @@ for (var i = 0; i < 1000; i++) {
endTime = new Date();
collatorTime = endTime.getTime() - startTime.getTime();
// Difference is within 20%.
assertTrue(collatorTime < cachedTime);
// Difference is within 20%. collatorTime should be smaller,
// but it can be noisy. Give an enough margin of error.
assertTrue(collatorTime < cachedTime * 1.5);
// Non-cached time is much slower, measured to 12.5 times.
assertTrue(cachedTime < nonCachedTime);
assertTrue(collatorTime < nonCachedTime);