Skip to content

Conversation

maxdml
Copy link
Collaborator

@maxdml maxdml commented Aug 17, 2025

  • One more pass at cleaning tests for testify: remove useless if statements
  • Fix workflow DLQ test (actually test that the workflow ends up in the DLQ after max retries)
  • small: remove a flaky test assertion
  • Reduce likelihood of ms-granularity collision in created_at timestamps. When this happens it can cause unexpected priority queuing behavior. Ideally we'd have microseconds granularity.
  • Add some delay between 2 PQ workflows for the test to circumvent the situation above.


- name: Run tests
run: go vet ./... && gotestsum --format github-action -- -race ./...
run: go vet ./... && gotestsum --format github-action -- -race -v -count=1 ./...
Copy link
Collaborator Author

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...

Comment on lines +227 to +245
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
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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

@maxdml maxdml merged commit e5044c5 into main Aug 18, 2025
2 checks passed
@maxdml maxdml deleted the more-testify branch August 18, 2025 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants