MCPcopy
hub / github.com/nats-io/nats.go / shutdownJSServerAndRemoveStorage

Function shutdownJSServerAndRemoveStorage

test/js_test.go:41–54  ·  view source on GitHub ↗
(t *testing.T, s *server.Server)

Source from the content-addressed store, hash-verified

39)
40
41func shutdownJSServerAndRemoveStorage(t *testing.T, s *server.Server) {
42 t.Helper()
43 var sd string
44 if config := s.JetStreamConfig(); config != nil {
45 sd = config.StoreDir
46 }
47 s.Shutdown()
48 if sd != "" {
49 if err := os.RemoveAll(sd); err != nil {
50 t.Fatalf("Unable to remove storage %q: %v", sd, err)
51 }
52 }
53 s.WaitForShutdown()
54}
55
56func restartBasicJSServer(t *testing.T, s *server.Server) *server.Server {
57 opts := natsserver.DefaultTestOptions

Calls 1

FatalfMethod · 0.80

Tested by

no test coverage detected