fix(behat): stop nested develop/pdf fetches causing cURL 52 flakes - #8430
Conversation
2418b8c to
df0cd2c
Compare
vitormattos
left a comment
There was a problem hiding this comment.
I agree with avoiding the request to the same PHP server here, but changing all URL fixtures to base64 means we will not have integration coverage for the url file source anymore.
FileContentProviderTest covers the service itself, but it does not verify that request-signature still accepts a {"url": ...} payload and correctly passes it to the file content provider.
Could we keep at least one integration test for the URL flow, using a fixture served by another local HTTP server instead of the same Behat PHP server?
4e83f73 to
dba2e74
Compare
|
I reran the failing Behat job with debug logging enabled to get more information from the PHP built-in server. Let's wait for this run and check if it gives us more details about the |
|
The last changes are starting to work around the failure instead of helping us understand it. The retry does not solve the problem. In the last CI run, after the first Please remove The PHP server is started by I suggest improving the verbose mode there so it permanently reports useful process information, including:
Please add tests for this behavior in After this is merged, we can create a new Then we can update At that point we should have better evidence about why the PHP server stops responding, instead of adding more workarounds here. |
@vitormattos |
Provide an inline data-URI from small_valid.pdf so scenarios can send PDFs without nested HTTP to the PHP built-in server. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Avoid request-signature downloading from the same Behat PHP server, which required multi-worker mode and caused cURL 52 empty-reply flakes. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
With fixtures no longer nesting HTTP to develop/pdf, a single-process php -S is enough and avoids experimental PHP_CLI_SERVER_WORKERS flakes. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
workers: 0 deadlocks any nested self-HTTP on php -S. Use the minimum of two workers while fixtures stay on inline PDF base64 to avoid the previous cURL 52 flakes from workers: 10. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Serve small_valid.pdf from a second local php -S process and add a
scenario that posts {"url":"<PDF_URL>"} so url download stays covered
without nested HTTP to the Behat Nextcloud server.
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Use SMALL_VALID_PDF_BASE64 / getSmallValidPdfBase64() (and matching URL names) so future fixtures can be added without ambiguous placeholders. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Failsafe for residual cURL 52 empty-reply flakes during Behat HTTP bursts; retries up to three times with backoff and STDERR diagnostics. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Retrying around cURL 52/7 hides the real failure and is unsafe for POST requests such as request-signature. Prefer diagnosing PHP built-in server death via behat-builtin-extension verbose mode. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
c201e74 to
061c454
Compare
|
@vitormattos following the original plan: Could you also tag |
Started the process here: LibreSign/nextcloud-behat#112 |
Unlock verbose PHP built-in server diagnostics so Behat CI can show PID, logs, and exit status on cURL 52 flakes. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
|
I’ll wait for the current CI run to finish first. After that, I’m going to rerun the Now that this branch is using |
vitormattos
left a comment
There was a problem hiding this comment.
Well... now everything passed 😅
Maybe the issue was really intermittent, or maybe one of the changes in behat-builtin-extension / nextcloud-behat fixed what was triggering it.
Since the full CI is green now, I think we can move forward. If cURL 52 comes back, at least now we have much better diagnostics to understand what happened.
|
Can I go ahead and merge this? I think that we also can make backport to stable branches >= 33 |
we can observe the upcoming CIs |
Go for it 😎 |
|
/backport to stable35 |
|
/backport to stable34 |
|
/backport to stable33 |
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Resolves: #8422
📝 Summary
Behat fixtures used
{"url":"<BASE_URL>/apps/libresign/develop/pdf"}, so eachrequest-signaturecall nested an HTTP GET to the same PHP built-in server. Combined with experimentalPHP_CLI_SERVER_WORKERS, that intermittently produced empty replies (cURL 52/ConnectException), often followed bycURL 7once the server stopped accepting connections—especially under burst load infile/list.feature.This PR:
<SMALL_VALID_PDF_BASE64>for fixtures that do not need to exercise URL download (inlinesmall_valid.pdf)<SMALL_VALID_PDF_URL>from a separate localFixtureHttpServerso URL download stays covered in integration without nested self-HTTP on the Behat PHP serverworkers: 2(single-worker deadlocks nested/self HTTP; high worker counts were flaky)request-signature, and hides the real failure)Further diagnosis of PHP built-in server death belongs in
libresign/behat-builtin-extensionverbose mode (see LibreSign/behat-builtin-extension#76 → intendedv0.6.4), then atests/integration/composer.lockbump on this branch.🧪 How to test
cd tests/integration vendor/bin/behat features/file/list.feature:45<SMALL_VALID_PDF_URL>(scenario inrequest.feature).behat-builtin-extensionv0.6.4is published: bumptests/integration/composer.lockand re-run Behat CI with debug (-v/BEHAT_VERBOSE) to capture server PID/logs/exit status if flakes remain.⚙️ API / Back‑end changes
FileContentProviderTest)composer openapiif necessary – N/A🚧 Tasks
libresign/behat-builtin-extensionv0.6.4(feat: improve verbose PHP built-in server diagnostics behat-builtin-extension#76)tests/integration/composer.lockto the new release✅ Checklist
🤖 AI (if applicable)