mirror of
https://github.com/foomo/keel.git
synced 2025-10-16 12:35:34 +00:00
test: add timeout
This commit is contained in:
parent
8f5bbd9b30
commit
c7a188048a
@ -33,6 +33,7 @@ func (s *KeelTestSuite) SetupSuite() {
|
||||
|
||||
// BeforeTest hook
|
||||
func (s *KeelTestSuite) BeforeTest(suiteName, testName string) {
|
||||
s.l = keeltest.NewLogger(s.T()).Zap()
|
||||
s.mux = http.NewServeMux()
|
||||
s.mux.HandleFunc("/ok", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
@ -65,6 +66,7 @@ func (s *KeelTestSuite) BeforeTest(suiteName, testName string) {
|
||||
// AfterTest hook
|
||||
func (s *KeelTestSuite) AfterTest(suiteName, testName string) {
|
||||
s.cancel()
|
||||
time.Sleep(time.Second * 3)
|
||||
}
|
||||
|
||||
// TearDownSuite hook
|
||||
@ -194,7 +196,6 @@ func (s *KeelTestSuite) runServer() {
|
||||
go func(waitChan chan string) {
|
||||
waitChan <- "finished"
|
||||
s.svr.Run()
|
||||
time.Sleep(time.Second * 3)
|
||||
}(waitChan)
|
||||
l.Debug("waiting for server process to start")
|
||||
<-waitChan
|
||||
|
||||
Loading…
Reference in New Issue
Block a user