Skip to content

Commit

Permalink
Add traces assertion in browser registry test
Browse files Browse the repository at this point in the history
  • Loading branch information
ka3de committed Nov 14, 2023
1 parent d5d78bf commit c3b56ca
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions browser/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ func TestBrowserRegistry(t *testing.T) {
assert.Equal(t, 3, len(browserRegistry.m))
browserRegistry.mu.RUnlock()

// Verify iteration traces are started
browserRegistry.tr.mu.Lock()
assert.Equal(t, 3, len(browserRegistry.tr.m))
browserRegistry.tr.mu.Unlock()

// Send IterEnd events
vu.EndIteration(t, k6test.WithIteration(0))
vu.EndIteration(t, k6test.WithIteration(1))
Expand All @@ -227,6 +232,11 @@ func TestBrowserRegistry(t *testing.T) {
browserRegistry.mu.RLock()
assert.Equal(t, 0, len(browserRegistry.m))
browserRegistry.mu.RUnlock()

// Verify iteration traces have been ended
browserRegistry.mu.RLock()
assert.Equal(t, 0, len(browserRegistry.m))
browserRegistry.mu.RUnlock()
})

t.Run("close_browsers_on_exit_event", func(t *testing.T) {
Expand Down

0 comments on commit c3b56ca

Please sign in to comment.