controlclient tests: fix more memory leaks and add resource checking.

I can now run these tests with -count=1000 without running out of RAM.

Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
This commit is contained in:
Avery Pennarun
2020-05-20 11:08:24 -04:00
parent d03de31404
commit c5fcc38bf1
3 changed files with 39 additions and 16 deletions

View File

@ -1148,7 +1148,11 @@ func (s *server) newClientWithKey(t *testing.T, name, authKey string) *client {
},
Hostinfo: hi,
NewDecompressor: func() (Decompressor, error) {
return zstd.NewReader(nil)
return zstd.NewReader(nil,
zstd.WithDecoderLowmem(true),
zstd.WithDecoderConcurrency(1),
zstd.WithDecoderMaxMemory(65536),
)
},
KeepAlive: true,
AuthKey: authKey,