mirror of
https://github.com/status-im/consul.git
synced 2025-02-16 15:47:21 +00:00
Test: add noCleanup to TestServer stop (#16919)
This commit is contained in:
parent
e5be4b4550
commit
82915d225f
@ -357,7 +357,13 @@ func NewTestServerConfigT(t TestingTB, cb ServerConfigCallback) (*TestServer, er
|
|||||||
// Stop stops the test Consul server, and removes the Consul data
|
// Stop stops the test Consul server, and removes the Consul data
|
||||||
// directory once we are done.
|
// directory once we are done.
|
||||||
func (s *TestServer) Stop() error {
|
func (s *TestServer) Stop() error {
|
||||||
defer os.RemoveAll(s.tmpdir)
|
defer func() {
|
||||||
|
if noCleanup {
|
||||||
|
fmt.Println("skipping cleanup because TEST_NOCLEANUP was enabled")
|
||||||
|
} else {
|
||||||
|
os.RemoveAll(s.tmpdir)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
// There was no process
|
// There was no process
|
||||||
if s.cmd == nil {
|
if s.cmd == nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user