From 5f33597353fffb46f714b016ff6376c8e899a192 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Tue, 23 Apr 2019 13:48:56 +0100 Subject: [PATCH] ext/File-Glob/t/rt131211.t: simplify timing This test file expects a glob which matches to be fast, and a glob which doesn't match also to be fast, but which used to be exponentially slow. Previous commits of mine have tried to avoid false positives for the failtime > 10 * passtime test when both pass and fail times are so small that the calculation is just comparing noise. This new change simplifies the logic to: fail if both fail time > 1 sec (slow) fail time > 10 * pass time (so pass was relatively fast) --- ext/File-Glob/t/rt131211.t | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ext/File-Glob/t/rt131211.t b/ext/File-Glob/t/rt131211.t index 9bca70c..96432de 100644 --- a/ext/File-Glob/t/rt131211.t +++ b/ext/File-Glob/t/rt131211.t @@ -61,13 +61,9 @@ is $count,10, "tried all the patterns without bailing out" or diag("elapsed_match=$elapsed_match elapsed_fail=$elapsed_fail"); -SKIP: { - skip "unstable or too small timing", 1 unless - $elapsed_match >= 0.01 && $elapsed_fail >= 0.01; - ok $elapsed_fail <= 10 * $elapsed_match, - "time to fail less than 10x the time to match" - or diag("elapsed_match=$elapsed_match elapsed_fail=$elapsed_fail"); -} +ok $elapsed_fail < 1 || $elapsed_fail <= 10 * $elapsed_match, + "time to fail should be less than 10x the time to match" + or diag("elapsed_match=$elapsed_match elapsed_fail=$elapsed_fail"); is "@got_files", catfile($path, $files[0]), "only got the expected file for xa*..b"; -- 1.8.3.1