Skip to content
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

Deflake TestCtrlCCapture #11687

Merged
merged 1 commit into from
Apr 4, 2022
Merged

Deflake TestCtrlCCapture #11687

merged 1 commit into from
Apr 4, 2022

Conversation

xacrimon
Copy link
Contributor

@xacrimon xacrimon commented Apr 3, 2022

As evidenced in #9492 (comment) this test for TermManager is flaky. The reasoning for it is in the linked comment.

This PR fixes the test flakiness, to do this I considered the following approaches

  1. Remove the default case when sending a termination notification
  2. Use a buffered channel

I investigated 1 but quickly realized that there would be issues. If we remove the default case, two concurrent notifications might attempt to send on the channel, as of the first notification, the channel will close and the second one will result in a panic which is highly undesirable.

A buffered approach seems more promising, this ensures that we can always catch the one termination notification in the test as the write no longer has to be in the background but that any additional ones will be discarded due to the default case which is desirable since the session shall terminate after the first one.

@xacrimon xacrimon requested review from espadolini and zmb3 April 3, 2022 20:15
@xacrimon xacrimon mentioned this pull request Apr 3, 2022
@xacrimon xacrimon enabled auto-merge (squash) April 4, 2022 13:47
@xacrimon xacrimon merged commit 316b981 into master Apr 4, 2022
@xacrimon xacrimon deleted the joel/terminate-flaky branch April 4, 2022 14:06
xacrimon added a commit that referenced this pull request Apr 7, 2022
* Write error and return on failed websocket upgrade (#11606)

* Broadcast controls keys if session is moderated (#11661)

* Clarify RBAC rule application (#11672)

* Use a buffered channel for the terminate notifier (#11687)

* Restrict moderated sessions users from accessing V8 kube cluster agents (#11691)
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.

4 participants