Skip to content

Commit 5f1a0fb

Browse files
committed
again
Signed-off-by: joshvanl <me@joshvanl.dev>
1 parent d2628e3 commit 5f1a0fb

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

tests/e2e/standalone/scheduler_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,11 +566,13 @@ func TestSchedulerDeleteAll(t *testing.T) {
566566
// Wait for all 8 scheduler entries to appear: 2 app jobs, 2 actor
567567
// reminders, 4 workflow/activity entries. Using countSchedulerEntries
568568
// avoids hard-coding a line count that breaks if the output format changes.
569+
// On slow macOS CI runners, workflow/activity entries can take over 60s to
570+
// register, so use a 120s timeout.
569571
require.EventuallyWithT(t, func(c *assert.CollectT) {
570572
output, err := cmdSchedulerList()
571573
require.NoError(t, err)
572574
assert.GreaterOrEqual(c, countSchedulerEntries(output), 8)
573-
}, 60*time.Second, time.Second)
575+
}, 120*time.Second, time.Second)
574576

575577
_, err := cmdSchedulerDeleteAll("app/test-scheduler")
576578
require.NoError(t, err)

tests/e2e/standalone/workflow_test.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,26 @@ func TestWorkflowReRun(t *testing.T) {
202202
output, err := cmdWorkflowRun(appID, "SimpleWorkflow", "--instance-id=foo")
203203
require.NoError(t, err, output)
204204

205-
// Wait for the workflow instance to be registered and queryable before
206-
// attempting rerun operations. On slow CI runners 3s is not enough.
205+
// Wait for the workflow instance to reach a terminal state before
206+
// attempting rerun operations. Rerun requires the instance to be in a
207+
// terminal state (COMPLETED/FAILED/TERMINATED).
207208
require.Eventually(t, func() bool {
208209
out, err := cmdWorkflowList(appID, redisConnString, "-o", "json")
209210
if err != nil {
210211
return false
211212
}
212-
return strings.Contains(out, "foo")
213-
}, 30*time.Second, time.Second, "workflow instance 'foo' did not appear in list")
213+
var list []map[string]interface{}
214+
if err := json.Unmarshal([]byte(out), &list); err != nil {
215+
return false
216+
}
217+
for _, item := range list {
218+
if item["instanceID"] == "foo" {
219+
status, _ := item["runtimeStatus"].(string)
220+
return status == "COMPLETED" || status == "FAILED" || status == "TERMINATED"
221+
}
222+
}
223+
return false
224+
}, 60*time.Second, time.Second, "workflow instance 'foo' did not reach terminal state")
214225

215226
t.Run("rerun from beginning", func(t *testing.T) {
216227
output, err := cmdWorkflowReRun(appID, "foo")

0 commit comments

Comments
 (0)