feat: observe workflow inbox backlog
This commit is contained in:
@@ -70,7 +70,7 @@ func TestIntegrationOperationalSnapshot(t *testing.T) {
|
||||
if got := snapshot.RecentEvents["task.accepted"]; got < 1 {
|
||||
t.Fatalf("accepted event was not observed: %#v", snapshot.RecentEvents)
|
||||
}
|
||||
if snapshot.TaskOldestAgeSeconds < 0 || snapshot.DeliveryOldestAgeSeconds < 0 || snapshot.WorkflowOldestAgeSeconds < 0 {
|
||||
if snapshot.TaskOldestAgeSeconds < 0 || snapshot.DeliveryOldestAgeSeconds < 0 || snapshot.WorkflowOldestAgeSeconds < 0 || snapshot.InboxOldestAgeSeconds < 0 {
|
||||
t.Fatalf("negative age in snapshot: %#v", snapshot)
|
||||
}
|
||||
for _, state := range []string{"WAITING", "LEASED", "RUNNING", "NEEDS_REVIEW", "SUCCEEDED", "FAILED", "CANCELLED"} {
|
||||
@@ -84,6 +84,11 @@ func TestIntegrationOperationalSnapshot(t *testing.T) {
|
||||
if _, ok := snapshot.WorkflowStates["RUNNING"]; !ok {
|
||||
t.Fatal("missing running workflow state")
|
||||
}
|
||||
for _, state := range []string{"PENDING", "LEASED", "PROCESSED", "QUARANTINED"} {
|
||||
if _, ok := snapshot.InboxStates[state]; !ok {
|
||||
t.Fatalf("missing fixed inbox state %q", state)
|
||||
}
|
||||
}
|
||||
f.exec("UPDATE pulse_tasks SET state='SUCCEEDED', completed_at=UTC_TIMESTAMP(6), updated_at=UTC_TIMESTAMP(6), revision=revision+1 WHERE namespace_id=? AND id=?", f.resources.NamespaceID, task.ID)
|
||||
completed, err := ReadOperationalSnapshot(ctx, db)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user