From be74961e942a9c57e92f98f1114c3a6b28d8ad0f Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Tue, 10 May 2022 19:11:47 -0600 Subject: [PATCH] still trying to fix race condition --- .gitlab-ci.yml | 2 +- cmd/mothd/httpd_test.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fa43a60..65fc796 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: test: stage: test - image: golang:1.17 + image: golang:1.18 only: refs: - main diff --git a/cmd/mothd/httpd_test.go b/cmd/mothd/httpd_test.go index fc4ae9a..f5482d2 100644 --- a/cmd/mothd/httpd_test.go +++ b/cmd/mothd/httpd_test.go @@ -33,7 +33,9 @@ func (hs *HTTPServer) TestRequest(path string, args map[string]string) *httptest } 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 { t.Error(r.Result()) @@ -113,6 +115,7 @@ func TestHttpd(t *testing.T) { } time.Sleep(TestMaintenanceInterval) + stateProvider.refresh() if r := hs.TestRequest("/content/pategory/2/puzzle.json", nil); r.Result().StatusCode != 200 { t.Error(r.Result())