chore(time skip): added examples for testing and time skipping in Java#4801
Open
flippedcoder wants to merge 3 commits into
Open
chore(time skip): added examples for testing and time skipping in Java#4801flippedcoder wants to merge 3 commits into
flippedcoder wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📖 Docs PR preview links
|
cb0c9f4 to
6e52f99
Compare
jsundai
reviewed
Jul 2, 2026
| - Time doesn't skip while Activities and Nexus operations are executing. | ||
|
|
||
| Start a test server process that skips time as needed. | ||
| For example, in the time-skipping mode, Timers, which include sleeps and conditional timeouts, are fast-forwarded except when Activities or Nexus Operation handlers are running. Nexus Operation handlers timeout after 10 seconds and time skipping is allowed while waiting for retries. |
Contributor
There was a problem hiding this comment.
I think we should keep this Nexus line!
jsundai
reviewed
Jul 2, 2026
| testEnv.sleep(Duration.ofHours(25)); | ||
| assertEquals(2, workflow.daysElapsed()); | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
I'll give this a full review sometime today!
jsundai
reviewed
Jul 2, 2026
| When you execute a Workflow and wait for the result, the test environment automatically skips Workflow timers such as `Workflow.sleep`. This means: | ||
|
|
||
| #### Skip time automatically {/* #automatic-method */} | ||
| - Workflow timers (like `Workflow.Sleep`) are fast-forwarded. |
Contributor
There was a problem hiding this comment.
small typo! - Workflow.sleep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This updates the testing best practices page for Java to have more of the content as the other SDK testing pages.
Notes to reviewers
┆Attachments: EDU-6629 chore(time skip): added examples for testing and time skipping in Java