Skip to content

ext/curl: speed up tests - #23228

Open
Sjord wants to merge 3 commits into
php:masterfrom
Sjord:curl-faster-tests
Open

ext/curl: speed up tests#23228
Sjord wants to merge 3 commits into
php:masterfrom
Sjord:curl-faster-tests

Conversation

@Sjord

@Sjord Sjord commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

By waiting shorter for the server to be ready. In my setup, this takes it from 26 to 15 seconds for all curl tests.

The first check for output on stderr takes approximately 10ms, so we wait 20ms to make sure its ready. The second check for the open port typically succeeds immediately, so move the sleep to after we have tried.

Disable Expect: 100-continue to prevent libcurl's 1-second delay.

@Sjord
Sjord marked this pull request as ready for review August 12, 2026 13:04
@Sjord
Sjord requested a review from adoy as a code owner August 12, 2026 13:04
@Sjord

Sjord commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@NickSdot Could you take a look at this?

@NickSdot NickSdot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Can confirm it's ~40% faster -- nice! Added one nit.

Comment thread ext/curl/tests/curl_setopt_ssl.phpt
Comment thread ext/curl/tests/bug54798-unix.phpt Outdated
@Sjord
Sjord force-pushed the curl-faster-tests branch from d8dd936 to 8fc637d Compare August 13, 2026 07:46

@LamentXU123 LamentXU123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me as an outsider.

@LamentXU123
LamentXU123 requested a review from devnexen August 13, 2026 11:03
Comment thread ext/curl/tests/server.inc
@Sjord
Sjord requested a review from devnexen August 13, 2026 19:26

@devnexen devnexen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems good but let s wait for another opinion I may know well enough curl C api but for tests infrastructure in general not that much, cc @iluuu1994

@Sjord

Sjord commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

An alternative for disabling expect/continue in the tests is to implement expect/continue in the PHP development server: #23245

Sjord added 3 commits August 18, 2026 18:40
By waiting shorter for the server to be ready. In my setup, this takes
it from 26 to 15 seconds for all curl tests.

The first check for output on stderr takes approximately 10ms, so we
wait 20ms to make sure its ready. The second check for the open port
typically succeeds immediately, so move the sleep to after we have
tried.
It was intentionally increased to 3 seconds in
php#2304
@Sjord
Sjord force-pushed the curl-faster-tests branch from 4a4d800 to 3f89765 Compare August 18, 2026 18:41
@Sjord

Sjord commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

I have removed the Expect: header changes from this PR, as that is better solved with #23245.

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.

5 participants