Skip to content

Commit b022ecb

Browse files
committed
test(h3): rebuild h3client harness when source is newer than binary
A stale h3client binary (predating #48, which unstalled response bodies > ~1 MiB) silently fails 028-h3-large-body and 032-h3-connection-migration with len=0 — looking like a server regression when the server is fine. SKIPIF only rebuilt the harness when the binary was missing, never when h3client.c had moved ahead of it. Rebuild on mtime staleness too.
1 parent e781dde commit b022ecb

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests/phpt/server/h3/_h3_skipif.inc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,14 @@ function h3_skipif(array $req = []): void {
6868
die('skip h3client harness is POSIX-only');
6969
}
7070
$client = __DIR__ . '/../../../h3client/h3client';
71-
if (!is_executable($client)) {
72-
$src = __DIR__ . '/../../../h3client/h3client.c';
71+
$src = __DIR__ . '/../../../h3client/h3client.c';
72+
/* Rebuild when the binary is missing OR the source is newer than
73+
* it: a stale binary from before a harness fix silently fails the
74+
* E2E tests (e.g. #48 unstalled bodies > 1 MiB — an old binary
75+
* still returns len=0 on 028/032 and looks like a server bug). */
76+
$stale = is_file($src) && is_file($client)
77+
&& @filemtime($src) > @filemtime($client);
78+
if (!is_executable($client) || $stale) {
7379
if (!is_file($src)) {
7480
die('skip h3client source missing');
7581
}

0 commit comments

Comments
 (0)