Skip to content

Commit

Permalink
Use RunOnEventLoop in k6/experimental/tracing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oleiade committed Jul 11, 2023
1 parent 489ac1f commit 4f152fd
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions js/modules/k6/experimental/tracing/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,11 @@ func TestCallingInstrumentedRequestEmitsTraceIdMetadata(t *testing.T) {
// Assert there is no trace_id key in vu metadata before calling an instrumented
// function, and that it's cleaned up after the call.
t.Cleanup(testCase.TestRuntime.EventLoop.WaitOnRegistered)
err = testCase.TestRuntime.EventLoop.Start(func() error {
_, err = rt.RunString(httpBin.Replacer.Replace(`
assert_has_trace_id_metadata(false)
http.request("GET", "HTTPBIN_URL")
assert_has_trace_id_metadata(false)
`))

return err
})
_, err = testCase.TestRuntime.RunOnEventLoop(httpBin.Replacer.Replace(`
assert_has_trace_id_metadata(false)
http.request("GET", "HTTPBIN_URL")
assert_has_trace_id_metadata(false)
`))
require.NoError(t, err)
close(samples)

Expand Down

0 comments on commit 4f152fd

Please sign in to comment.