GNU bug report logs - #51023
[PATCH] gnu: php: patch failing test case

Previous Next

Package: guix-patches;

Reported by: Ryan Sundberg <ryan <at> arctype.co>

Date: Tue, 5 Oct 2021 04:20:02 UTC

Severity: normal

Tags: patch

Done: Tobias Geerinckx-Rice <me <at> tobias.gr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51023 in the body.
You can then email your comments to 51023 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#51023; Package guix-patches. (Tue, 05 Oct 2021 04:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ryan Sundberg <ryan <at> arctype.co>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 05 Oct 2021 04:20:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ryan Sundberg <ryan <at> arctype.co>
To: guix-patches <at> gnu.org
Cc: Ryan Sundberg <ryan <at> arctype.co>
Subject: [PATCH] gnu: php: patch failing test case
Date: Mon,  4 Oct 2021 21:18:45 -0700
Fixes a failing test case in php (Zend/tests/bug74093.phpt)
See https://github.com/php/php-src/pull/7555/files for upstream status.

* gnu/local.mk: Include patch file php-bug-74093-test.patch
* gnu/packages/patches/php-bug-74093-test.patch: Patch file
* gnu/packages/php.scm: Add patch to php
---
 gnu/local.mk                                  |  1 +
 gnu/packages/patches/php-bug-74093-test.patch | 49 +++++++++++++++++++
 gnu/packages/php.scm                          |  1 +
 3 files changed, 51 insertions(+)
 create mode 100644 gnu/packages/patches/php-bug-74093-test.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index c9888100f7..63f9446686 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1589,6 +1589,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/perl-reproducible-build-date.patch	\
   %D%/packages/patches/perl-www-curl-fix-struct-void.patch	\
   %D%/packages/patches/perl-www-curl-remove-symbol.patch	\
+  %D%/packages/patches/php-bug-74093-test.patch \
   %D%/packages/patches/picard-fix-id3-rename-test.patch		\
   %D%/packages/patches/picprog-non-intel-support.patch		\
   %D%/packages/patches/pidgin-add-search-path.patch		\
diff --git a/gnu/packages/patches/php-bug-74093-test.patch b/gnu/packages/patches/php-bug-74093-test.patch
new file mode 100644
index 0000000000..48fb47c67e
--- /dev/null
+++ b/gnu/packages/patches/php-bug-74093-test.patch
@@ -0,0 +1,49 @@
+From c641825c64e42627a2c9cac969b371ed532e0b57 Mon Sep 17 00:00:00 2001
+From: Ryan Sundberg <ryan <at> arctype.co>
+Date: Mon, 4 Oct 2021 20:12:25 -0700
+Subject: [PATCH] Zend/tests/bug74093.phpt: Fix failing test case
+
+This test case fails (on non-Windows hosts, where it is enabled) due
+to mismatching output in the error log language. This fixes the
+expectation, and also rewrites the test procedure in a more stable
+fashion.
+
+The objective of the test case is to run a program that exceeds
+the max_execution_time and verify that the process was aborted. The
+previous implementation tested this using a loop on array_intersect with
+large enough inputs to "probably" take enough time to trigger
+max_execution_time to abort it. With faster CPUs, over time this test
+can become flaky. Instead we simply spin a loop until enough
+wall clock time has passed to check our assertion.
+---
+ Zend/tests/bug74093.phpt | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/Zend/tests/bug74093.phpt b/Zend/tests/bug74093.phpt
+index 7f20285805..32eb445ddc 100644
+--- a/Zend/tests/bug74093.phpt
++++ b/Zend/tests/bug74093.phpt
+@@ -1,5 +1,5 @@
+ --TEST--
+-Bug #74093 (Maximum execution time of n+2 seconds exceed not written in error_log)
++Bug #74093 (Maximum execution time exceeded not written in error_log)
+ --SKIPIF--
+ <?php
+ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
+@@ -12,9 +12,9 @@ max_execution_time=1
+ hard_timeout=1
+ --FILE--
+ <?php
+-$a1 = range(1, 1000000);
+-$a2 = range(100000, 1999999);
+-array_intersect($a1, $a2);
++$start = time();
++while (time() - $start < 5);
++die("Failed to interrupt execution");
+ ?>
+ --EXPECTF--
+-Fatal error: Maximum execution time of 1+1 seconds exceeded %s
++Fatal error: Maximum execution time of 1 second exceeded in %s
+-- 
+2.31.1
+
diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
index 89fa978bd2..e6df1e6666 100644
--- a/gnu/packages/php.scm
+++ b/gnu/packages/php.scm
@@ -69,6 +69,7 @@
               (sha256
                (base32
                 "1s5xjy1cchlg0vfxic73wy2wip8spfjr094hzzyc76plsbbqq1wf"))
+              (patches (search-patches "php-bug-74093-test.patch"))
               (modules '((guix build utils)))
               (snippet
                '(with-directory-excursion "ext"
-- 
2.31.1





Reply sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
You have taken responsibility. (Tue, 05 Oct 2021 11:57:02 GMT) Full text and rfc822 format available.

Notification sent to Ryan Sundberg <ryan <at> arctype.co>:
bug acknowledged by developer. (Tue, 05 Oct 2021 11:57:02 GMT) Full text and rfc822 format available.

Message #10 received at 51023-done <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Ryan Sundberg <ryan <at> arctype.co>
Cc: 51023-done <at> debbugs.gnu.org
Subject: Re: [bug#51023] [PATCH] gnu: php: patch failing test case
Date: Tue, 05 Oct 2021 13:47:24 +0200
[Message part 1 (text/plain, inline)]
Ryan,

Ryan Sundberg via Guix-patches via 写道:
> Fixes a failing test case in php (Zend/tests/bug74093.phpt)
> See https://github.com/php/php-src/pull/7555/files for upstream 
> status.

Thanks!  PHP is notorious for

 sleep 4 # this is how long x took to y on my laptop in 2014

but it's the bane of many test suites (and, hence, us)…

> * gnu/local.mk: Include patch file php-bug-74093-test.patch
> * gnu/packages/patches/php-bug-74093-test.patch: Patch file
> * gnu/packages/php.scm: Add patch to php

Thanks for writing a GNU/Guix-style commit message.  I made only a 
few tweaks, mainly adding full stops and (section)[things].

   gnu: php: Patch failing test case.

   Fixes a failing test case in PHP (Zend/tests/bug74093.phpt). 
   See
   <https://github.com/php/php-src/pull/7555/files> for upstream 
   status.

   * gnu/packages/php.scm (php)[source]: Add patch.
   * gnu/packages/patches/php-bug-74093-test.patch: New file.
   * gnu/local.mk (dist_patch_DATA): Add it.

The * line order is just what I'm used to writing, nothing more.

Pushed as 9aaf402a379b9ac9e4c3eee5b16f7496d7606e91!

Kind regards,

T G-R
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 03 Nov 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 175 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.