From 4a2738185b0f7dfe735d1ba019d33c779bc0b6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Tue, 8 Aug 2017 15:21:48 +0200 Subject: [PATCH] Fix File::Glob rt131211.t test random failures --- ...rt131211.t-to-be-less-sensitive-on-w.patch | 45 +++++++++++++++++++ perl.spec | 6 +++ 2 files changed, 51 insertions(+) create mode 100644 perl-5.27.1-File-Glob-tweak-rt131211.t-to-be-less-sensitive-on-w.patch diff --git a/perl-5.27.1-File-Glob-tweak-rt131211.t-to-be-less-sensitive-on-w.patch b/perl-5.27.1-File-Glob-tweak-rt131211.t-to-be-less-sensitive-on-w.patch new file mode 100644 index 0000000..6407a06 --- /dev/null +++ b/perl-5.27.1-File-Glob-tweak-rt131211.t-to-be-less-sensitive-on-w.patch @@ -0,0 +1,45 @@ +From b4d257e2d408f0f1c6686dcdc112f3ebfec68f44 Mon Sep 17 00:00:00 2001 +From: Yves Orton +Date: Tue, 27 Jun 2017 10:22:23 +0200 +Subject: [PATCH] File::Glob - tweak rt131211.t to be less sensitive on wonky + boxes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +make the test less senstive and avoid divide by zero errors, +also we skip the test if either elapsed_match or elapsed_fail is +true, as we can not rely on the timings then. For the operations +we are doing we should get a non-zero timing from Time::HiRes. + +This should mean that running this test on boxes with heavy +load, etc, will no longer result in false positives. + +Signed-off-by: Petr Písař +--- + ext/File-Glob/t/rt131211.t | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/ext/File-Glob/t/rt131211.t b/ext/File-Glob/t/rt131211.t +index c1bcbe0..b29cd04 100644 +--- a/ext/File-Glob/t/rt131211.t ++++ b/ext/File-Glob/t/rt131211.t +@@ -49,8 +49,13 @@ while (++$count < 10) { + is $count,10, + "tried all the patterns without bailing out"; + +-cmp_ok $elapsed_fail/$elapsed_match,"<",2, +- "time to fail less than twice the time to match"; ++SKIP: { ++ skip "unstable timing", 1 unless $elapsed_match && $elapsed_fail; ++ 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"); ++} ++ + is "@got_files", catfile($path, $files[0]), + "only got the expected file for xa*..b"; + is "@no_files", "", "shouldnt have files for xa*..c"; +-- +2.9.4 + diff --git a/perl.spec b/perl.spec index ab2ec2a..17c3a8e 100644 --- a/perl.spec +++ b/perl.spec @@ -182,6 +182,9 @@ Patch42: perl-5.27.1-PATCH-perl-131646-Assertion-fail-UTF-8-error-msg.pat Patch43: perl-5.27.1-t-lib-warnings-utf8-Fix-test.patch Patch44: perl-5.27.2-perl-131646-make-the-test-less-fragile.patch +# Fix File::Glob rt131211.t test random failures, in upstream after 5.27.1 +Patch45: perl-5.27.1-File-Glob-tweak-rt131211.t-to-be-less-sensitive-on-w.patch + # Link XS modules to libperl.so with EU::CBuilder on Linux, bug #960048 Patch200: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch @@ -2754,6 +2757,7 @@ Perl extension for Version Objects %patch42 -p1 %patch43 -p1 %patch44 -p1 +%patch45 -p1 %patch200 -p1 %patch201 -p1 @@ -2784,6 +2788,7 @@ perl -x patchlevel.h \ 'Fedora Patch39: Fix a conditional jump on uninitilized memory in re_intuit_start() (RT#131575)' \ 'Fedora Patch40: Fix spurious "Assuming NOT a POSIX class" warning (RT#131522)' \ 'Fedora Patch42: Fix reporting malformed UTF-8 character (RT#131646)' \ + 'Fedora Patch45: Fix File::Glob rt131211.t test random failures' \ 'Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on Linux' \ 'Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux' \ %{nil} @@ -5069,6 +5074,7 @@ popd %changelog * Tue Aug 08 2017 Petr Pisar - 4:5.26.0-398 - Fix reporting malformed UTF-8 character (RT#131646) +- Fix File::Glob rt131211.t test random failures * Sat Jul 29 2017 Igor Gnatenko - 4:5.26.0-397 - Enable separate debuginfo back