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 <minelson@vmware.com>
Signed-off-by: Michael Nelson <minelson@vmware.com>
5e459da to
2ed9c55
Compare
Signed-off-by: Michael Nelson <minelson@vmware.com>
antgamdia
left a comment
There was a problem hiding this comment.
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.
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.
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 minelson@vmware.com
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
TokenCredentialRequestthat 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-envcrate which can be used to ensure just that.Benefits
No more transient failures for these tests.
Possible drawbacks
None
Applicable issues
Additional information