Repository navigation
Fix resources/test (when running locally) - #10127
Conversation
|
cc @lukebjerring you should be able to debug your PR locally with this patch. |
Build PASSEDStarted: 2018-03-22 19:05:17 View more information about this build on: |
|
Yep, this lets me past the issue I was having. |
|
Fixed the SSL issue. The PR is now ready for review :) |
jugglinmike
left a comment
There was a problem hiding this comment.
I can't reproduce the issue locally, but I can at least verify that this doesn't regress tox on my system.
| # Exponential backoff. | ||
| wait = 1 | ||
| for _ in range(5): | ||
| time.sleep(wait) |
There was a problem hiding this comment.
If we move this to the end of the loop body, we might avoid unnecessary startup delays. What do you think?
There was a problem hiding this comment.
Also, time.sleep(_ ** 2) might make your intention more clear (along with renaming _ and removing wait)
There was a problem hiding this comment.
I actually put it here intentionally as I noticed wptserve did take a short while to start and the first attempt often failed.
You meant 2 ** iterations right? Yeah that'd be a bit cleaner. Let me change it.
|
@jugglinmike thanks. A bit more details: Creating a SSL context is actually quite tricky. Explicitly specifying TLS/SSL version isn't portable as newer OpenSSL may deprecate older, unsafe protocols (in fact, produce a fatal error). There is a new constant |
1. Check the HTTP port of wptserve instead of HTTPS to avoid the unnecessary complexities of setting up SSL context (which may fail in some environments). 2. Use exponential backoff when waiting for wptserve and specify a maximum retry to avoid indefinite hang. 3. Use `terminate` instead of `kill` to give wptserve a chance to clean up, which is especially useful when running locally. WPTServe.url still returns a HTTPS URL to make sure tests that require secure context (e.g. service workers) still work.
c18d546 to
c6e42ae
Compare
unnecessary complexities of setting up SSL context (which may fail in
some environments, depending on the system OpenSSL version).
maximum retry to avoid indefinite hang.
terminateinstead ofkillto give wptserve a chance to cleanup, which is especially useful when running locally.
Fixes #10114.
This change is