diff --git a/internal/raw/raw_test.go b/internal/raw/raw_test.go index 5619c13..552a694 100644 --- a/internal/raw/raw_test.go +++ b/internal/raw/raw_test.go @@ -3,11 +3,14 @@ package raw import ( "context" "math/rand" + "runtime" + "runtime/debug" "testing" "time" ) func TestStartFlooding(t *testing.T) { + debug.SetGCPercent(-1) srcIps := getIps() srcPorts := getPorts() macAddrs := getMacAddrs() @@ -52,8 +55,10 @@ func TestStartFlooding(t *testing.T) { case <-ctx.Done(): cancel() t.Logf("context closed, caseName=%s, floodType=%s, floodMilliSeconds=%d\n", tc.name, tc.floodType, tc.floodMilliSeconds) + runtime.GC() case <-time.After(120 * time.Second): t.Log("overslept") + runtime.GC() } }) }