diff options
author | David Mitchell <davem@iabyn.com> | 2019-04-23 13:48:56 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2019-04-23 13:48:56 +0100 |
commit | 5f33597353fffb46f714b016ff6376c8e899a192 (patch) | |
tree | 465676be693ee5dc74f2741284230478074b33ca /ext/File-Glob | |
parent | d88a90861c6e7d97c1551ff76fff5ae790117795 (diff) | |
download | perl-5f33597353fffb46f714b016ff6376c8e899a192.tar.gz |
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)
Diffstat (limited to 'ext/File-Glob')
-rw-r--r-- | ext/File-Glob/t/rt131211.t | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/ext/File-Glob/t/rt131211.t b/ext/File-Glob/t/rt131211.t index 9bca70c17f..96432de466 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"; |