Skip to content

Commit 35a658a

Browse files
fjtiradoCopilot
andcommitted
Wait timeouttest refinement
Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: fjtirado <ftirados@ibm.com>
1 parent eef3bed commit 35a658a

1 file changed

Lines changed: 3 additions & 22 deletions

File tree

impl/test/src/test/java/io/serverlessworkflow/impl/test/WaitExecutorTest.java

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ static void tearDown() {
5555
// ========== DurationInline Tests ==========
5656

5757
@Test
58-
@Disabled("This one slow down")
58+
@Disabled(
59+
"Disabled because it waits 1s and slows the suite; DSL mapping is covered by testWaitSecondsConvenienceMethod")
5960
void testWaitWithDurationInlineSeconds() {
6061
Workflow workflow =
6162
WorkflowBuilder.workflow("wait-inline-seconds", "test", "0.1.0")
@@ -87,7 +88,6 @@ void testWaitWithDurationInlineMilliseconds() {
8788

8889
@Test
8990
void testWaitWithDurationInlineComposite() {
90-
// Test composite duration with multiple components
9191
Workflow workflow =
9292
WorkflowBuilder.workflow("wait-inline-composite", "test", "0.1.0")
9393
.tasks(DSL.wait(Duration.ofMillis(100).plusMillis(100)))
@@ -98,7 +98,7 @@ void testWaitWithDurationInlineComposite() {
9898
long elapsed = System.currentTimeMillis() - startTime;
9999

100100
assertThat(model).isNotNull();
101-
assertThat(elapsed).isGreaterThanOrEqualTo(200); // 1 second + 500 milliseconds
101+
assertThat(elapsed).isGreaterThanOrEqualTo(200);
102102
}
103103

104104
// ========== DurationLiteral Tests (TimeoutAfter.durationLiteral) ==========
@@ -122,25 +122,6 @@ void testWaitWithDurationLiteralISO8601Seconds() {
122122
assertThat(elapsed).isGreaterThanOrEqualTo(1000);
123123
}
124124

125-
@Test
126-
void testWaitWithDurationLiteralISO8601Composite() {
127-
Workflow workflow =
128-
WorkflowBuilder.workflow("wait-literal-composite", "test", "0.1.0")
129-
.tasks(
130-
list ->
131-
list.wait(
132-
w ->
133-
w.build().setWait(new TimeoutAfter().withDurationExpression("PT0.1S"))))
134-
.build();
135-
136-
long startTime = System.currentTimeMillis();
137-
WorkflowModel model = appl.workflowDefinition(workflow).instance(Map.of()).start().join();
138-
long elapsed = System.currentTimeMillis() - startTime;
139-
140-
assertThat(model).isNotNull();
141-
assertThat(elapsed).isGreaterThanOrEqualTo(100);
142-
}
143-
144125
@Test
145126
void testWaitWithDurationLiteralISO8601Milliseconds() {
146127
// PT0.1S = 100 milliseconds

0 commit comments

Comments
 (0)