@@ -57,6 +57,9 @@ public int signalThenCallEntityOrchestration(
5757 // Signal — fire-and-forget
5858 ctx .signalEntity (entityId , "add" , input .addValue );
5959
60+ // Wait for the signal to be processed before reading state
61+ ctx .createTimer (java .time .Duration .ofSeconds (2 )).await ();
62+
6063 // Call — request-response (should see the updated state)
6164 return ctx .callEntity (entityId , "get" , null , Integer .class ).await ();
6265 }
@@ -89,6 +92,9 @@ public String comprehensiveEntityOrchestration(
8992 ctx .signalEntity (counterId , "add" , 5 );
9093 result .append ("Step 1: Signaled add(5)\n " );
9194
95+ // Wait for the signal to be processed before reading state
96+ ctx .createTimer (java .time .Duration .ofSeconds (2 )).await ();
97+
9298 // Test 2: callEntity (request-response) — get current value, should be 5
9399 int valueAfterAdd5 = ctx .callEntity (counterId , "get" , null , Integer .class ).await ();
94100 result .append ("Step 2: callEntity get() returned " ).append (valueAfterAdd5 ).append ("\n " );
@@ -97,6 +103,9 @@ public String comprehensiveEntityOrchestration(
97103 ctx .signalEntity (counterId , "add" , 10 );
98104 result .append ("Step 3: Signaled add(10)\n " );
99105
106+ // Wait for the signal to be processed before reading state
107+ ctx .createTimer (java .time .Duration .ofSeconds (2 )).await ();
108+
100109 // Test 4: callEntity — get current value, should be 15
101110 int valueAfterAdd10 = ctx .callEntity (counterId , "get" , null , Integer .class ).await ();
102111 result .append ("Step 4: callEntity get() returned " ).append (valueAfterAdd10 ).append ("\n " );
@@ -105,6 +114,9 @@ public String comprehensiveEntityOrchestration(
105114 ctx .signalEntity (counterId , "reset" );
106115 result .append ("Step 5: Signaled reset()\n " );
107116
117+ // Wait for the signal to be processed before reading state
118+ ctx .createTimer (java .time .Duration .ofSeconds (2 )).await ();
119+
108120 // Test 6: callEntity — get current value, should be 0
109121 int valueAfterReset = ctx .callEntity (counterId , "get" , null , Integer .class ).await ();
110122 result .append ("Step 6: callEntity get() returned " ).append (valueAfterReset ).append ("\n " );
0 commit comments