Skip to content

test(s3): fix flaky EOF check and remove PHP 8.5 skip#61275

Open
joshtrichards wants to merge 2 commits into
masterfrom
jtr/test-S3-testFileSizes
Open

test(s3): fix flaky EOF check and remove PHP 8.5 skip#61275
joshtrichards wants to merge 2 commits into
masterfrom
jtr/test-S3-testFileSizes

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Jun 13, 2026

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

Fix S3Test::testFileSizes() so it no longer relies on an invalid EOF behavior assumption and remove the temporary PHP 8.5 CI skip.

Changes

  • replace the immediate feof() check after fseek() with a read-at-EOF assertion
  • assert seek success explicitly
  • use stricter assertSame() checks for byte comparisons
  • simplify the chunk-writing loop used to generate test input
  • remove the temporary PHP 8.5 skip

Why

readObject() returns a seekable HTTP-backed stream, and feof() is not a reliable thing to assert immediately after seeking to the end of that stream.

Depending on buffering and wrapper behavior, EOF may only be established after a read attempt. Verifying that a read at EOF returns no bytes better matches the behavior this test intends to validate and avoids CI flakiness. The original exclusion by PHP version was for PHP 8.3 (#47388), but recently was changed to 8.5 (#61158). Presumably it's no longer needed (if evidence suggests otherwise going forward we should figure out why / fix the test).

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added this to the Nextcloud 35 milestone Jun 13, 2026
@joshtrichards joshtrichards added 2. developing Work in progress tests Related to tests CI labels Jun 13, 2026
Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 13, 2026
@joshtrichards joshtrichards marked this pull request as ready for review June 13, 2026 14:43
@joshtrichards joshtrichards requested a review from a team as a code owner June 13, 2026 14:43
@joshtrichards joshtrichards requested review from Altahrim, ArtificialOwl and leftybournes and removed request for a team June 13, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant