Skip to content

Commit

Permalink
Backport outbound queues test changes (#4120) to main (#4139)
Browse files Browse the repository at this point in the history
This backports the changes to the outbound queues test to the `main`
branch.

Signed-off-by: Neil Twigg <neil@nats.io>
  • Loading branch information
derekcollison committed May 9, 2023
2 parents 76f4358 + d7ae2cb commit 6e6ce3a
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions server/norace_test.go
Expand Up @@ -7916,16 +7916,13 @@ func TestNoRaceClientOutboundQueueMemory(t *testing.T) {
diff := float64(ha) - float64(hb)
inc := (diff / float64(hb)) * 100

fmt.Printf("Message size: %.1fKB\n", ms/1024)
fmt.Printf("Subscribed clients: %d\n", len(clients))
fmt.Printf("Heap allocs before: %.1fMB\n", hb/1024/1024)
fmt.Printf("Heap allocs after: %.1fMB\n", ha/1024/1024)
fmt.Printf("Heap allocs delta: %.1f%%\n", inc)

// TODO: What threshold makes sense here for a failure?
/*
if inc > 10 {
t.Fatalf("memory increase was %.1f%% (should be <= 10%%)", inc)
}
*/
if inc > 10 {
t.Logf("Message size: %.1fKB\n", ms/1024)
t.Logf("Subscribed clients: %d\n", len(clients))
t.Logf("Heap allocs before: %.1fMB\n", hb/1024/1024)
t.Logf("Heap allocs after: %.1fMB\n", ha/1024/1024)
t.Logf("Heap allocs delta: %.1f%%\n", inc)

t.Fatalf("memory increase was %.1f%% (should be <= 10%%)", inc)
}
}

0 comments on commit 6e6ce3a

Please sign in to comment.