update test server listen on same port.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
81da87a137
commit
5a6236ecfe
|
@ -28,8 +28,6 @@ func TestRunNormalServer(t *testing.T) {
|
||||||
|
|
||||||
gin.SetMode(gin.TestMode)
|
gin.SetMode(gin.TestMode)
|
||||||
|
|
||||||
router := gin.New()
|
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
assert.NoError(t, RunHTTPServer())
|
assert.NoError(t, RunHTTPServer())
|
||||||
}()
|
}()
|
||||||
|
@ -37,7 +35,7 @@ func TestRunNormalServer(t *testing.T) {
|
||||||
// otherwise the main thread will complete
|
// otherwise the main thread will complete
|
||||||
time.Sleep(5 * time.Millisecond)
|
time.Sleep(5 * time.Millisecond)
|
||||||
|
|
||||||
assert.Error(t, router.Run(":8088"))
|
assert.Error(t, RunHTTPServer())
|
||||||
gofight.TestRequest(t, "http://localhost:8088/api/status")
|
gofight.TestRequest(t, "http://localhost:8088/api/status")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue