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
some times, k6 won't emit the metrics for https://test.k6.io/?stage=teardown-end or the last teardown_counter=10 count. This seems to happen because the Engine's finalization code (pushing its last buffered metrics) and the outputs' finalization code (pushing their last metrics) are triggered by cancelling the same context...
Basically, this Engine.processSamples() is racing with the output's finalization - the engine may push some metrics to the outputs after they have stopped listening for them...
The text was updated successfully, but these errors were encountered:
na--
changed the title
Race between outputs and the engine's
Race between outputs and the engine's finalization
Aug 25, 2020
na--
changed the title
Race between outputs and the engine's finalization
Race between outputs' and the engine's end-of-test finalization
Aug 25, 2020
na--
changed the title
Race between outputs' and the engine's end-of-test finalization
Race between the outputs' and the engine's end-of-test finalization
Aug 25, 2020
If you have a script like that:
some times, k6 won't emit the metrics for
https://test.k6.io/?stage=teardown-end
or the lastteardown_counter=10
count. This seems to happen because theEngine
's finalization code (pushing its last buffered metrics) and the outputs' finalization code (pushing their last metrics) are triggered by cancelling the same context...They both output as:
https://github.com/loadimpact/k6/blob/c68a4eb450aa0a806b16bef3206ba2163f05e2a7/cmd/run.go#L154-L169
https://github.com/loadimpact/k6/blob/c68a4eb450aa0a806b16bef3206ba2163f05e2a7/cmd/run.go#L268
https://github.com/loadimpact/k6/blob/c68a4eb450aa0a806b16bef3206ba2163f05e2a7/core/engine.go#L156
Here's the output path:
https://github.com/loadimpact/k6/blob/c68a4eb450aa0a806b16bef3206ba2163f05e2a7/core/engine.go#L170-L176
https://github.com/loadimpact/k6/blob/c68a4eb450aa0a806b16bef3206ba2163f05e2a7/stats/cloud/collector.go#L218-L220
https://github.com/loadimpact/k6/blob/c68a4eb450aa0a806b16bef3206ba2163f05e2a7/stats/cloud/collector.go#L261-L263
Here's the Engine's:
https://github.com/loadimpact/k6/blob/c68a4eb450aa0a806b16bef3206ba2163f05e2a7/core/engine.go#L178-L183
https://github.com/loadimpact/k6/blob/c68a4eb450aa0a806b16bef3206ba2163f05e2a7/core/engine.go#L295-L297
https://github.com/loadimpact/k6/blob/c68a4eb450aa0a806b16bef3206ba2163f05e2a7/core/engine.go#L252-L266
Basically, this
Engine.processSamples()
is racing with the output's finalization - the engine may push some metrics to the outputs after they have stopped listening for them...The text was updated successfully, but these errors were encountered: