compliance: don't leak test directory

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
This commit is contained in:
Tycho Andersen
2020-03-09 15:08:31 -06:00
committed by Ramkumar Chinchani
parent 404c83fbc1
commit 4774aa81b3
+2 -1
View File
@@ -5,6 +5,7 @@ import (
"context"
"fmt"
"io/ioutil"
"os"
"testing"
"time"
@@ -56,7 +57,6 @@ func startServer() (*api.Controller, string) {
panic(err)
}
//defer os.RemoveAll(dir)
ctrl.Config.Storage.RootDirectory = dir
go func() {
// this blocks
@@ -80,4 +80,5 @@ func startServer() (*api.Controller, string) {
func stopServer(ctrl *api.Controller) {
ctrl.Server.Shutdown(context.Background())
os.RemoveAll(ctrl.Config.Storage.RootDirectory)
}