-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Ensure we don't miss the resolution of an access request #9193
Conversation
How should I go about adding a test for this? #9003 has some instructions on how to replicate it, but it could also be tested by artificially increasing the time it takes for the watcher to be ready in the code. |
fdb7501
to
a6fdc22
Compare
@fspmarshall Any suggestions for @espadolini on how to write tests for this? |
a6fdc22
to
c9acdcb
Compare
After some minor refactoring, the watcher now waits for access request updates on the root cluster, rather than whatever cluster we're currently connected to. |
c9acdcb
to
f913c5d
Compare
I added a test for the "access request while logged into a leaf cluster" scenario, it fails on I'm still not sure how to make a specific test for the spurious hangs of #9003; the test I just added does go through the codepath, so if we get a regression and the bug resurfaces we might eventually hit it in our CI runs anyway. |
cc729ff
to
851d062
Compare
f456904
to
4915ab9
Compare
@espadolini Since this update removes the cause of the spurious hangs, I don't think there is a reasonable way to try to replicate them in a test. As you said, we cover the codepath, so if a new spurious hang is introduced, hopefully we'll catch it. |
4915ab9
to
9b1eb0a
Compare
@espadolini Please backport this to |
dd033de
to
4ce2e07
Compare
4ce2e07
to
928b3c0
Compare
928b3c0
to
acc84f0
Compare
Right now
tsh
fires up a watcher to wait for the access request to be resolved and then creates the request; however it doesn't wait for the watcher to be ready, and so it's possible to miss the resolution of the request (be it approval, denial or removal) and we get a hang.This makes it so that we wait for the watcher to be ready before proceeding with the request creation. In addition, we create the watcher on the root cluster rather than whatever cluster we're connected to.
Closes #9003 and #9244.