-
Notifications
You must be signed in to change notification settings - Fork 8.1k
ext/curl: speed up tests #23228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
ext/curl: speed up tests #23228
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -74,7 +74,10 @@ if ($process === false) { | |||||
| } | ||||||
| try { | ||||||
| // Give the server time to start | ||||||
| sleep(1); | ||||||
| for ($i = 0; $i < 100; $i++) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe 50 is enough? Would match the previous 1s;
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, 50 (or even 10 or 20) would work. 100 is just a number that's high but not infinite. In normal operation this loop will only iterate a couple of times, and 50 or 100 is never reached. If you are worried about the time this test takes when the server fails to start, perhaps a better way is to get the server process status with |
||||||
| if (@fsockopen('127.0.0.1', $port)) break; | ||||||
| usleep(20000); | ||||||
| } | ||||||
|
|
||||||
| echo "case 1: client cert and key from string\n"; | ||||||
| $ch = curl_init("https://127.0.0.1:$port/"); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I ask where the 1 second delay come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expect 100-continue is a flow control mechanism that is not apparently not supported by the PHP development server. Curl waits one second for a 100-continue response and then continues anyway.
https://everything.curl.dev/http/post/expect100.html