Skip to content
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

Fix potential data race reports when the -race flag is enabled. #1847

Merged
merged 1 commit into from
Aug 31, 2024

Conversation

newacorn
Copy link
Contributor

The testClientDoTimeoutError and testClientGetTimeoutSuccess test function does not immediately return or fatal when the test fails. Instead, it continues to stringify the byte slice that was passed as the dst parameter to the Client.GetTimeout method. If the test fails due to a timeout, the request may still be ongoing, and there might be a data race between writing to dst and the stringification operation.

Other test cases also continue to access the body after a request failure, but they are not related to timeouts. I believe this should not be an issue.

The `testClientDoTimeoutError` and `testClientGetTimeoutSuccess` test function does not immediately return or fatal when the test fails. Instead, it continues to stringify the byte slice that was passed as the `dst` parameter to the `Client.GetTimeout` method. If the test fails due to a timeout, the request may still be ongoing, and there might be a data race between writing to `dst` and the stringification operation.
@erikdubbelboer erikdubbelboer merged commit f789432 into valyala:master Aug 31, 2024
15 checks passed
@erikdubbelboer
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants