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

Add tests for cancellation #236

Merged
merged 2 commits into from
Dec 19, 2023
Merged

Conversation

tillrohrmann
Copy link
Contributor

@tillrohrmann tillrohrmann commented Dec 18, 2023

This commit adds new e2e tests which ensure that cancellation works.
The following call chains are canceled:

  • CancelTestService/StartTest --> BlockingService/Block --> BlockingSerivce/Block (inboxed call since BlockingService is singleton)
  • CancelTestService/StartTest --> BlockingService/Block --> uncompleted awakeable
  • CancelTestService/StartTest --> BlockingService/Block --> very long sleep

This fixes #228.

For these e2e tests to work, we need to merge the following PRs first:

settings.gradle.kts Outdated Show resolved Hide resolved
services/node-services/src/cancel_test.ts Outdated Show resolved Hide resolved
services/node-services/src/cancel_test.ts Outdated Show resolved Hide resolved
Comment on lines 108 to 110
// The termination signal might arrive before the blocking call to the cancel singleton was
// made,
// so we need to retry.
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can add a sync point with AwakeableHolder to CancelTestService as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This wouldn't work for example when sleeping in the BlockingService. Will keep it as is.

@tillrohrmann
Copy link
Contributor Author

Thanks for the review @slinkydeveloper. I've addressed your comments. PTAL.

This commit adds new e2e tests which ensure that cancellation works.
The following call chains are canceled:

* CancelTestService/StartTest --> BlockingService/Block --> BlockingSerivce/Block (inboxed call since BlockingService is singleton)
* CancelTestService/StartTest --> BlockingService/Block --> uncompleted awakeable
* CancelTestService/StartTest --> BlockingService/Block --> very long sleep

This fixes restatedev#228.
@tillrohrmann tillrohrmann merged commit 58e590b into restatedev:main Dec 19, 2023
1 check failed
@tillrohrmann tillrohrmann deleted the issues/228 branch December 19, 2023 11:32
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.

End-to-End tests for cancellation
2 participants