test(sdk): Disable on-disk auth cache in mock tests - #1985
Merged
Conversation
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>
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The end-to-end tests in openstack_sdk/src/test.rs were flaky under
cargo test(often deterministically failing when run serially) whilepassing under
cargo nextest.httpmock's process-global server pool reuses the same port for
consecutive tests, so each test's
auth_urland therefore its~/.osc/<auth_hash>cache key are identical. A token or discoverydocument 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 suitenever touches disk state.
Signed-off-by: Artem Goncharov artem.goncharov@gmail.com