(t *testing.T, clusterName string, size int, tfn func(t *testing.T, srvs ...*jsServer))
| 290 | } |
| 291 | |
| 292 | func withJSCluster(t *testing.T, clusterName string, size int, tfn func(t *testing.T, srvs ...*jsServer)) { |
| 293 | t.Helper() |
| 294 | |
| 295 | nodes := setupJSClusterWithSize(t, clusterName, size) |
| 296 | defer func() { |
| 297 | // Ensure that they get shutdown and remove their state. |
| 298 | for _, node := range nodes { |
| 299 | node.restart.Lock() |
| 300 | shutdownJSServerAndRemoveStorage(t, node.Server) |
| 301 | node.restart.Unlock() |
| 302 | } |
| 303 | }() |
| 304 | tfn(t, nodes...) |
| 305 | } |
| 306 | |
| 307 | func restartBasicJSServer(t *testing.T, s *server.Server) *server.Server { |
| 308 | opts := natsserver.DefaultTestOptions |
no test coverage detected