You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when the test suite is run with the -race flag, a few race conditions appear. I think that one of them is this (or related to it), while another one seems to be related to metrics collection of http requests that reuse the same connection.
The end goal here is to enable the -race flag for CI tests runs so we don't regress in the future.
The text was updated successfully, but these errors were encountered:
The metrics collection race condition is because we use httptrace.ClientTrace incorrectly. From the docs:
Functions may be called concurrently from different goroutines and some may be called after the request has completed or failed.
Regarding ClientTrace.ConnectStart and ClientTrace.ConnectDone specifically:
If net.Dialer.DualStack (IPv6 "Happy Eyeballs") support is this may be called multiple times.
And ClientTrace.WroteRequest:
It may be called multiple times in the case of retried requests.
The k6 code that uses ClientTrace has a lot of reads and writes for the same variables without any synchronization, so it has to be refactored. I'm not sure that a bunch of mutexes is the correct approach here, something event-based seems like a better solution, for example each of the ClientTrace methods could just create an event, send it over a channel and something else can synchronously and safely process them.
Currently when the test suite is run with the
-race
flag, a few race conditions appear. I think that one of them is this (or related to it), while another one seems to be related to metrics collection of http requests that reuse the same connection.The end goal here is to enable the
-race
flag for CI tests runs so we don't regress in the future.The text was updated successfully, but these errors were encountered: