mirror of https://github.com/dirtbags/moth.git
still trying to fix race condition
This commit is contained in:
parent
d014384b05
commit
be74961e94
|
@ -4,7 +4,7 @@ stages:
|
||||||
|
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
image: golang:1.17
|
image: golang:1.18
|
||||||
only:
|
only:
|
||||||
refs:
|
refs:
|
||||||
- main
|
- main
|
||||||
|
|
|
@ -33,7 +33,9 @@ func (hs *HTTPServer) TestRequest(path string, args map[string]string) *httptest
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestHttpd(t *testing.T) {
|
func TestHttpd(t *testing.T) {
|
||||||
hs := NewHTTPServer("/", NewTestServer())
|
server := NewTestServer()
|
||||||
|
hs := NewHTTPServer("/", server)
|
||||||
|
stateProvider := server.State.(*State)
|
||||||
|
|
||||||
if r := hs.TestRequest("/", nil); r.Result().StatusCode != 200 {
|
if r := hs.TestRequest("/", nil); r.Result().StatusCode != 200 {
|
||||||
t.Error(r.Result())
|
t.Error(r.Result())
|
||||||
|
@ -113,6 +115,7 @@ func TestHttpd(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(TestMaintenanceInterval)
|
time.Sleep(TestMaintenanceInterval)
|
||||||
|
stateProvider.refresh()
|
||||||
|
|
||||||
if r := hs.TestRequest("/content/pategory/2/puzzle.json", nil); r.Result().StatusCode != 200 {
|
if r := hs.TestRequest("/content/pategory/2/puzzle.json", nil); r.Result().StatusCode != 200 {
|
||||||
t.Error(r.Result())
|
t.Error(r.Result())
|
||||||
|
|
Loading…
Reference in New Issue