mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 13:18:53 +00:00
nettest, *: add option to run HTTP tests with in-memory network
To avoid ephemeral port / TIME_WAIT exhaustion with high --count values, and to eventually detect leaked connections in tests. (Later the memory network will register a Cleanup on the TB to verify that everything's been shut down) Updates tailscale/corp#27636 Change-Id: Id06f1ae750d8719c5a75d871654574a8226d2733 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
6d117d64a2
commit
c76d075472
@@ -58,3 +58,10 @@ func InParallelTest(t TB) (isParallel bool) {
|
||||
t.Chdir(".") // panics in a t.Parallel test
|
||||
return false
|
||||
}
|
||||
|
||||
// AssertInTest panics if called outside of a test binary.
|
||||
func AssertInTest() {
|
||||
if !InTest() {
|
||||
panic("func called outside of test binary")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user