Skip to content

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
@pdoerner pdoerner merged commit f458e8a into master Aug 18, 2025
28 of 30 checks passed
@pdoerner pdoerner deleted the nexus-cancel-test-improvements branch August 18, 2025 20:08
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.

3 participants