fix(module,fetch): wait for module initialization to prevent false failure in test

This commit is contained in:
wpetit 2023-04-06 14:46:46 +02:00
parent 054e80bbfb
commit f758acb4e5
1 changed files with 7 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"io/ioutil"
"net/url"
"testing"
"time"
"cdr.dev/slog"
"forge.cadoles.com/arcad/edge/pkg/app"
@ -42,7 +43,12 @@ func TestFetchModule(t *testing.T) {
t.Fatalf("%+v", errors.WithStack(err))
}
ctx := context.Background()
// Wait for module to startup
time.Sleep(1 * time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
remoteAddr := "127.0.0.1"
url, _ := url.Parse("http://example.com")