X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=auth-token-fetch%2Fmain_test.go;fp=auth-token-fetch%2Fmain_test.go;h=c575614219dae101c90043ff10af1ba1f3b83fba;hb=f7ac7674cdb0834946a222cabfdd154486119069;hp=1b0a87e971a8b4e0a559b8b5f95c315b29903e22;hpb=0d129fcb9c18a4fdc989a4c338d8407fea76ee97;p=nonrtric.git diff --git a/auth-token-fetch/main_test.go b/auth-token-fetch/main_test.go index 1b0a87e9..c5756142 100644 --- a/auth-token-fetch/main_test.go +++ b/auth-token-fetch/main_test.go @@ -68,6 +68,7 @@ func TestFetchAndStoreToken(t *testing.T) { configuration.AuthTokenOutputFileName = "/tmp/authToken" + fmt.Sprint(time.Now().UnixNano()) configuration.ClientId = "testClientId" configuration.ClientSecret = "testClientSecret" + configuration.RefreshMarginSeconds = 1 context := NewContext(configuration) t.Cleanup(func() { @@ -75,7 +76,7 @@ func TestFetchAndStoreToken(t *testing.T) { }) accessToken := "Access_token" + fmt.Sprint(time.Now().UnixNano()) - token := JwtToken{Access_token: accessToken, Expires_in: 10, Token_type: "Token_type"} + token := JwtToken{Access_token: accessToken, Expires_in: 7, Token_type: "Token_type"} wg := sync.WaitGroup{} wg.Add(2) // Get token two times @@ -83,7 +84,7 @@ func TestFetchAndStoreToken(t *testing.T) { go periodicRefreshIwtToken(clientMock, context) - if waitTimeout(&wg, 7*time.Second) { + if waitTimeout(&wg, 12*time.Second) { t.Error("Not all calls to server were made") t.Fail() }