-
Notifications
You must be signed in to change notification settings - Fork 38
actually check DLQ #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…me order but might complete out of order.
|
||
- name: Run tests | ||
run: go vet ./... && gotestsum --format github-action -- -race ./... | ||
run: go vet ./... && gotestsum --format github-action -- -race -v -count=1 ./... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This disables "caching" for the tests...
assert.Equal(t, WorkflowStatusPending, status.Status, "expected workflow to be in PENDING status after recovery") | ||
} | ||
|
||
dlqHandle, err := recoverPendingWorkflows(dbosCtx.(*dbosContext), []string{"local"}) | ||
require.NoError(t, err, "failed to recover pending workflows") | ||
assert.Len(t, dlqHandle, 1, "expected 1 handle in DLQ") | ||
retries := 0 | ||
for { | ||
dlqStatus, err := dlqHandle[0].GetStatus() | ||
require.NoError(t, err, "failed to get status of DLQ workflow handle") | ||
if dlqStatus.Status != WorkflowStatusRetriesExceeded && retries < 10 { | ||
time.Sleep(1 * time.Second) // Wait a bit before checking again | ||
retries++ | ||
continue | ||
} | ||
require.NoError(t, err, "failed to get status of DLQ workflow handle") | ||
assert.Equal(t, WorkflowStatusRetriesExceeded, dlqStatus.Status, "expected workflow to be in DLQ after max retries exceeded") | ||
handles = append(handles, dlqHandle[0]) | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we were not actually testing the DLQ behavior in this test -- now we do
}() | ||
|
||
typedHandle := newWorkflowHandle[R](handle.dbosContext, handle.workflowID, typedOutcomeChan) | ||
typedHandle := newWorkflowHandle(handle.dbosContext, handle.workflowID, typedOutcomeChan) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessary because inferred from typedOutcomeChan
created_at
timestamps. When this happens it can cause unexpected priority queuing behavior. Ideally we'd have microseconds granularity.