[PATCH] [nginx-tests] Tests: Add sleep to sub_filter_multi.t for TEST_NGINX_UNSAFE=1

Hiroaki Nakamura hnakamur at gmail.com
Tue Jun 18 22:15:53 UTC 2024


# HG changeset patch
# User Hiroaki Nakamura <hnakamur at gmail.com>
# Date 1718746554 -32400
#      Wed Jun 19 06:35:54 2024 +0900
# Node ID 8d9e1bc9721896618b0bb4095e39be46ca8fc280
# Parent  a095b971fbcc99a77206173f6130d5ff2681c389
Add sleep to sub_filter_multi for NGINX_TEST_UNSAFE=1

Without this fix, sub_filter_multi.t fails like below:
```
$ sudo -u nginx TEST_NGINX_UNSAFE=1
TEST_NGINX_BINARY=../freenginx/objs/nginx prove sub_filter_multi.t
sub_filter_multi.t .. 37/44
#   Failed test 'shortbuf match 1.3'
#   at sub_filter_multi.t line 366.
#                   undef
#     doesn't match '(?^:(+ABCDE){3})'
sub_filter_multi.t .. 42/44
#   Failed test 'shortbuf match 5'
#   at sub_filter_multi.t line 376.
#                   undef
#     doesn't match '(?^:+ABCDE(-*nyABCDE){2})'
# Looks like you failed 2 tests of 44.
sub_filter_multi.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/44 subtests
```

diff -r a095b971fbcc -r 8d9e1bc97218 sub_filter_multi.t
--- a/sub_filter_multi.t        Tue Jun 04 18:38:01 2024 +0300
+++ b/sub_filter_multi.t        Wed Jun 19 06:35:54 2024 +0900
@@ -363,8 +363,8 @@
        qr/(+A){3}/, 'shortbuf match 1.1');
 like(http_get('/shortbuf/match1?a=' . 'abpatternyzABCD' x 3),
        qr/(+ABCD){3}/, 'shortbuf match 1.2');
-like(http_get('/shortbuf/match1?a=' . 'abpatternyzABCDE' x 3),
-       qr/(+ABCDE){3}/, 'shortbuf match 1.3');
+like(http_get('/shortbuf/match1?a=' . 'abpatternyzABCDE' x 3, sleep => 1),
+               qr/(+ABCDE){3}/, 'shortbuf match 1.3');
 like(http_get('/shortbuf/match2?a=' . 'abpatternyzAabpaernyzB' x 2),
        qr/(+A-B){2}/, 'shortbuf match 2.1 (multiple replace)');
 like(http_get('/shortbuf/match2?a=' . 'abpatternyzAabpaernyz' x 2),
@@ -373,7 +373,7 @@
        qr/(+A*){3}/, 'shortbuf match 3 (1 byte search pattern)');
 like(http_get('/shortbuf/match4?a=' . 'pattABCDEFGHI' x 3),
        qr/(+ABCDEFGHI){3}/, 'shortbuf match 4');
-like(http_get('/shortbuf/match5?a=abpatternyzABCDE' . 'abpatternyABCDE' x 2),
+like(http_get('/shortbuf/match5?a=abpatternyzABCDE' .
'abpatternyABCDE' x 2, sleep => 1),
        qr/+ABCDE(-*nyABCDE){2}/, 'shortbuf match 5');
 }



More information about the nginx-devel mailing list