Skip to content

Improve Nexus cancellation type test assertions #2016

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pdoerner
Copy link
Contributor

@pdoerner pdoerner commented Aug 7, 2025

What was changed

Small improvements to Nexus cancellation types test assertions and remove sleeps to reduce flakiness.

@pdoerner pdoerner requested a review from a team as a code owner August 7, 2025 16:15
@pdoerner pdoerner requested a review from dandavison August 7, 2025 16:15
Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a lot of context on these tests but definitely endorse using predictable signals and channels over timers.

Comment on lines +1080 to +1084
if o.unblockCancelCh != nil {
// Should only be non-nil in the TRY_CANCEL case.
<-o.unblockCancelCh
}
return o.workflowRunOp.Cancel(ctx, token, options)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to also eventually cancel in the TRY_CANCEL case? What's the expected behavior when the workflow is eventually canceled? Do we assert anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just need to delay the cancel request. It doesn't have to eventually cancel, but immediately returning an error would just cause a NEXUS_OPERATION_CANCEL_REQUEST_FAILED event which would unblock WAIT_REQUESTED making TRY_CANCEL and WAIT_REQUESTED the same.

@pdoerner pdoerner enabled auto-merge (squash) August 7, 2025 19:34
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.

2 participants