Skip to content

Add concurrent waitForCondition example, and add examples to cloud tests#268

Merged
nvasiu merged 1 commit intomainfrom
waitforcondition-new-example
Mar 26, 2026
Merged

Add concurrent waitForCondition example, and add examples to cloud tests#268
nvasiu merged 1 commit intomainfrom
waitforcondition-new-example

Conversation

@nvasiu
Copy link
Contributor

@nvasiu nvasiu commented Mar 25, 2026

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

N/A

Description

  • Added a new ConcurrentWaitForConditionExample example that uses map to run 100 concurrently.
  • Simplified the existing waitForCondition example
  • Added both examples to the SAM template, and to the cloud based integration tests

Demo/Screenshots

N/A

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

Have unit tests been written for these changes?

N/A

Integration Tests

Have integration tests been written for these changes?

N/A

Examples

Has a new example been added for the change? (if applicable)

Yes, there is a new ConcurrentWaitForConditionExample.

@nvasiu nvasiu requested a review from a team March 25, 2026 23:23
public String handleRequest(Integer threshold, DurableContext context) {
var items = IntStream.range(0, 100).boxed().toList();

var config = MapConfig.builder().maxConcurrency(50).build();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make iterations and max concurrency input parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will make an update to this PR

var operationResults = allOperationsOutput.split(" \\| ");
assertEquals(100, operationResults.length);
for (var operationResult : operationResults) {
assertEquals("3", operationResult);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we assert the duration of waitForCondition operations?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is local runner, never mind. We can assert the duration only in our cloud tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will make an update to this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added duration check for each operation in the cloud test

@nvasiu nvasiu force-pushed the waitforcondition-new-example branch from a9f3b69 to 28128dc Compare March 26, 2026 17:24
zhongkechen
zhongkechen previously approved these changes Mar 26, 2026
zhongkechen
zhongkechen previously approved these changes Mar 26, 2026
Description: Concurrent Wait For Condition Example Function ARN
Value: !GetAtt ConcurrentWaitForConditionExampleFunction.Arn

ConcurrentWaitForConditionExampleFunctionName:
Copy link
Contributor

Choose a reason for hiding this comment

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

I doubt if all these outputs are useful

@nvasiu nvasiu merged commit 03fddad into main Mar 26, 2026
11 checks passed
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