Skip to content

api-test: retry token refresh on transient IDP failures - #3507

Merged
v-scharf merged 3 commits into
mainfrom
test/token-refresh-fallback-to-login
Sep 11, 2026
Merged

api-test: retry token refresh on transient IDP failures#3507
v-scharf merged 3 commits into
mainfrom
test/token-refresh-fallback-to-login

Conversation

@v-scharf

Copy link
Copy Markdown
Contributor

problem:

Failed step: Given these users have been created with default attributes:
        cURL error 18: SSL certificate OpenSSL verify result: self-signed certificate (18) (see https://curl.se/libcurl/c/libcurl-errors.html) for https://opencloud-server:9200/konnect/v1/token (GuzzleHttp\Exception\ResponseTransferException)
      | folder/ | /           |

log:

{"level":"error","service":"auth-basic","host.name":"6265023e23a4","pkg":"rgrpc","error":"LDAP Result Code 200 \"Network Error\": dial tcp [::1]:9236: connect: connection refused","time":"2026-09-10T10:18:22Z","message":"could not get ldap Connection"}
{"level":"error","service":"proxy","error":"could not authenticate with username and password user: admin, got code: 15","authenticator":"basic","path":"/graph/v1.0/users/admin","time":"2026-09-10T10:18:22Z","message":"failed to authenticate request"}

Solution:
The admin token is cached ~4 min, so it gets refreshed mid-suite against konnect/v1/token. A brief idm/LDAP (:9236) blip in that window kills the refresh (cURL 18 / non-200) and fails the scenario setup.

Fix in TokenHelper: retry token exchange on transport errors (3x, 1s backoff), and on any refresh failure drop the cache and fall back to a full login.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@v-scharf
v-scharf marked this pull request as ready for review September 10, 2026 14:07
Comment thread tests/acceptance/TestHelpers/TokenHelper.php
@v-scharf
v-scharf requested review from fschade and micbar September 10, 2026 14:32
@v-scharf
v-scharf merged commit 35e4d4a into main Sep 11, 2026
57 of 58 checks passed
@v-scharf
v-scharf deleted the test/token-refresh-fallback-to-login branch September 11, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants