Closed abhinav closed 1 month ago
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
LGTM, will let @Quinn-With-Two-Ns review
CI failing looks like an issue with the server v1.24.0
docker images. Will follow up with the server team.
What was changed
Background: testsuite.StartDevServer accepts a context.Context meant to indicate how long the caller is willing to wait for the result. This context is used when downloading the Temporal CLI, but is not considered when trying to dial to the server in
waitServerReady
.Change: This changes
waitServerReady
to respect the timeout configured in the context--checking in on it after each attempt, and returning early if the context has expired. Similarly, theDial
attempt now usesDialContext
so that if the context expires, the dial operation also returns early if it can.Why?
Without this, if an attempt to start the server failed (e.g. because of an invalid
--log-format
argument),waitServerReady
will block the test for 1 minute before giving up and returning an error. This is a pretty long time to wait for a test to fail, when the caller is expecting, say, 5 seconds at most.Checklist
How was this tested: A unit test was added for the new functionality, and run with
go test -run WaitServerReady -count 1000
to verify that it's not flaky.Any docs updates needed? I don't think so.