Skip to content

test(sdk): Disable on-disk auth cache in mock tests - #1985

Merged
gtema merged 1 commit into
mainfrom
fix_flaky_tests
Sep 8, 2026
Merged

test(sdk): Disable on-disk auth cache in mock tests#1985
gtema merged 1 commit into
mainfrom
fix_flaky_tests

Conversation

@gtema

@gtema gtema commented Sep 8, 2026

Copy link
Copy Markdown
Owner

The end-to-end tests in openstack_sdk/src/test.rs were flaky under
cargo test (often deterministically failing when run serially) while
passing under cargo nextest.

httpmock's process-global server pool reuses the same port for
consecutive tests, so each test's auth_url and therefore its
~/.osc/<auth_hash> cache key are identical. A token or discovery
document persisted by one test then satisfied a later test and
suppressed the HTTP calls it asserts on. nextest hid this by running one
test per process, leaving no predecessor to populate the cache.

Set auth_cache: Some(false) on the test CloudConfigs so the suite
never touches disk state.

Signed-off-by: Artem Goncharov artem.goncharov@gmail.com

The end-to-end tests in openstack_sdk/src/test.rs were flaky under
`cargo test` (often deterministically failing when run serially) while
passing under `cargo nextest`.

httpmock's process-global server pool reuses the same port for
consecutive tests, so each test's `auth_url` and therefore its
`~/.osc/<auth_hash>` cache key are identical. A token or discovery
document persisted by one test then satisfied a later test and
suppressed the HTTP calls it asserts on. nextest hid this by running one
test per process, leaving no predecessor to populate the cache.

Set `auth_cache: Some(false)` on the test CloudConfigs so the suite
never touches disk state.

Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
@gtema gtema linked an issue Sep 8, 2026 that may be closed by this pull request
@gtema gtema mentioned this pull request Sep 8, 2026
@gtema
gtema merged commit b321d0d into main Sep 8, 2026
20 checks passed
@gtema-release-plz gtema-release-plz Bot mentioned this pull request Sep 8, 2026
@gtema
gtema deleted the fix_flaky_tests branch September 11, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failing tests in v0.13.8

1 participant