gvisor icon indicating copy to clipboard operation
gvisor copied to clipboard

Use testing.synctest to ensure all goroutines exit before checking memory leaks in tcp e2e tests

Open uzairnawaz opened this issue 1 month ago • 0 comments

Solves #5940

Existing tcp e2e tests use a time.Sleep call to guarantee that all spawned goroutines get cleaned up before running a leak check. This PR instead uses synctest.Test on each testcase with a synctest.Wait() call to guarantee that test case goroutines don't exit until all child goroutines are cleaned up.

This was done with the following script: https://gist.github.com/uzairnawaz/d8a891c2a8072690e180a1027c69f90f

uzairnawaz avatar Dec 11 '25 00:12 uzairnawaz