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

WaitFor #980

Merged
merged 77 commits into from
Jan 12, 2024
Merged

WaitFor #980

merged 77 commits into from
Jan 12, 2024

Conversation

serprex
Copy link
Contributor

@serprex serprex commented Jan 4, 2024

NormalizeFlowCountQuery is stunting implementing decoupled sync/normalize workflows. So replace it with WaitFor

Besides, I just don't like this ExitAfterRecords way of doing things
e2e tests are integration tests: implementation should be treated as a black box as much as possible
Temporal has a bunch of capabilities to mock activities so that we can create unit tests for the more intrusive tests that'd be necessary to raise branch coverage etc

WaitFor presents the ideal mechanism for testing convergent processes: update source, wait for destination to reflect change

In order to make this change work, however, I needed to use env.CancelWorkflow after completing tests since I now want the workflow running indefinitely. It turns out our code doesn't adequately handle cancellation, so implemented that

@serprex serprex force-pushed the wait-for branch 7 times, most recently from c4b65d5 to 29a3daa Compare January 5, 2024 16:49
@serprex serprex mentioned this pull request Jan 6, 2024
flow/e2e/congen.go Show resolved Hide resolved
flow/e2e/congen.go Show resolved Hide resolved
flow/e2e/congen.go Show resolved Hide resolved
@serprex
Copy link
Contributor Author

serprex commented Jan 12, 2024

b9843c7 passed, but rerunning to check for flakiness

Copy link
Contributor

@Amogh-Bharadwaj Amogh-Bharadwaj left a comment

Choose a reason for hiding this comment

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

lgtm

flow/e2e/test_utils.go Show resolved Hide resolved
@@ -216,7 +216,8 @@ func CDCFlowWorkflowWithConfig(
RetryPolicy: &temporal.RetryPolicy{
MaximumAttempts: 20,
},
SearchAttributes: mirrorNameSearch,
SearchAttributes: mirrorNameSearch,
WaitForCancellation: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Tested it out with cancelling a few sync flows and it's fine to keep it (or remove it - whichever helps more).

@serprex serprex merged commit 267fd25 into main Jan 12, 2024
7 checks passed
@serprex serprex deleted the wait-for branch February 5, 2024 16:44
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