Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
Fix number of clients to close, add some comments and better name a
variable.
  • Loading branch information
belimawr committed Apr 9, 2024
1 parent d4909c6 commit b92b2f4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions libbeat/publisher/pipeline/pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ import (
)

func TestPipelineAcceptsAnyNumberOfClients(t *testing.T) {
if testing.Short() {
t.Skip("Skipping because short is enabled")
}

routinesChecker := resources.NewGoroutinesChecker()
defer routinesChecker.Check(t)

Expand All @@ -60,13 +56,15 @@ func TestPipelineAcceptsAnyNumberOfClients(t *testing.T) {
}

// Close the first 105 clients
nn := 6
tmpC := clients[:n]
nn := 105
clientsToClose := clients[:n]
clients = clients[nn:]

for _, c := range tmpC {
for _, c := range clientsToClose {
c.Close()
}

// Let other goroutines run
runtime.Gosched()
runtime.Gosched()

Expand Down

0 comments on commit b92b2f4

Please sign in to comment.