Use TempDir in more tests

Signed-off-by: Neil Twigg <neil@nats.io>
This commit is contained in:
Neil Twigg
2023-09-04 16:10:25 +01:00
parent e11ddb8bfe
commit 8de83bc2ef
5 changed files with 160 additions and 193 deletions

View File

@@ -45,9 +45,10 @@ func testDefaultClusterOptionsForLeafNodes() *Options {
return &o
}
func RunRandClientPortServer() *Server {
func RunRandClientPortServer(t *testing.T) *Server {
opts := DefaultTestOptions
opts.Port = -1
opts.StoreDir = t.TempDir()
return RunServer(&opts)
}