add stop server to API 4 tests (#6638)

This commit is contained in:
Saturnino Abril
2017-06-14 14:29:05 -07:00
committed by Corey Hulen
parent 1138dd6770
commit 5b017171cd
2 changed files with 15 additions and 0 deletions
+6
View File
@@ -105,6 +105,12 @@ func Setup() *TestHelper {
return th
}
func StopServer() {
if app.Srv != nil {
app.StopServer()
}
}
func TearDown() {
utils.DisableDebugLogForTest()
+9
View File
@@ -71,3 +71,12 @@ func TestWebSocket(t *testing.T) {
}
}
}
func TestZZWebSocketTearDown(t *testing.T) {
// *IMPORTANT* - Kind of hacky
// This should be the last function in any test file
// that calls Setup()
// Should be in the last file too sorted by name
time.Sleep(2 * time.Second)
StopServer()
}