moby/libnetwork/testutils
Cory Snider afa41b16ea libnetwork/testutils: restore netns on teardown
testutils.SetupTestOSContext() sets the calling thread's network
namespace but neglected to restore it on teardown. This was not a
problem in practice as it called runtime.LockOSThread() twice but
runtime.UnlockOSThread() only once, so the tampered threads would be
terminated by the runtime when the test case returned and replaced with
a clean thread. Correct the utility so it restores the thread's network
namespace during teardown and unlocks the goroutine from the thread on
success.

Remove unnecessary runtime.LockOSThread() calls peppering test cases
which leverage testutils.SetupTestOSContext().

Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-10-24 15:37:46 -04:00
..
context_unix.go libnetwork/testutils: restore netns on teardown 2022-10-24 15:37:46 -04:00
context_windows.go gofmt GoDoc comments with go1.19 2022-07-08 19:56:23 +02:00
net.go Fix issues running libnetwork tests. 2021-06-01 22:14:41 +00:00