-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-enable hash tests after unsuccessfully trying to repro. #5550
Conversation
✅ Deploy Preview for kubeapps-dev canceled.Built without sensitive environment variables
|
Woo - CI for the win:
|
Perhaps CI will repro the bug for us. Signed-off-by: Michael Nelson <[email protected]>
Signed-off-by: Michael Nelson <[email protected]>
5e459da
to
2ed9c55
Compare
Signed-off-by: Michael Nelson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix and for the explanation... concurrency seems to be always the root cause of most of the "transient errors", haha. +1, but please do not merge the PR until we trigger the release, otherwise, the OSL file will get out of sync.
"serial_test", | ||
"temp-env", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we are waiting for the OSM team to provide the licenses file, we need to hold this change back for now. Please, do not merge it until the release 2.6.1 has been triggered 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this is a dev-dependency
only, I wonder if we can update the licenses file to exclude dev-only dependencies? (In that, nothing about it is being released).
Heh - yeah, though I'd be more specific and blame concurrent writes of a global variable (in this case an environment variable). Concurrency should become the norm, but our programming needs to update. Ironically, Rust does a huge amount to stop you accessing actual language variables concurrently for writes etc., but it can't do much when we're updating an OS-level variable in different places.
Yep, ok. I'll wait until the release is triggered etc. Thanks Antonio. |
Perhaps CI will repro the bug for us.
Signed-off-by: Michael Nelson [email protected]
Description of the change
I'd created #4900 in June after noticing occasional failures, but then not seeing those in CI at all, so we didn't land the PR until Antonio noted the errors occurring again nearly 3 months later.
I've just tried to reproduce the transient failure in a few different comments (now and then), unsuccessfully, so am not sure how we can move forward other than re-enabling for now in the hope that CI may trigger the issue, if it still exists.The issue was that part of the
TokenCredentialRequest
that is generated for the test depends on an env variable (specifically,DEFAULT_PINNIPED_API_SUFFIX
) which was also set in another testtest_get_api_group_getters
. Rust runs tests concurrently, so if the test happened to be run in a thread of the same process before the hash test, then they would generate a different (but predictable) hash. The actual different hash can be reproduced simply by setting the env var manually to the same value set in the test:The solution is to ensure that the tests which modify the environment restore the environment after completing, and that any test which depends on those environment variables run with a mutex (so they don't run concurrently). Hence using the
temp-env
crate which can be used to ensure just that.Benefits
No more transient failures for these tests.
Possible drawbacks
None
Applicable issues
Additional information