Skip to content

Add history task write test hook#10583

Draft
stephanos wants to merge 5 commits into
mainfrom
stephanos/history-tasks-written
Draft

Add history task write test hook#10583
stephanos wants to merge 5 commits into
mainfrom
stephanos/history-tasks-written

Conversation

@stephanos
Copy link
Copy Markdown
Contributor

@stephanos stephanos commented Jun 6, 2026

Summary

Add a focused HistoryTasksWritten test hook in the execution manager after successful task-producing writes

Make TaskQueueRecorder opt-in.

Why

This removes the fx.Decorate reference. One step closer to the goal of deleting the separate onebox.go fx graph all-together and making use of the production fx graph from the temporal package instead.

Net LOC diff is -280.

@stephanos stephanos mentioned this pull request Jun 6, 2026
9 tasks
Comment thread tests/testcore/onebox.go
Comment on lines -486 to -491
fx.Decorate(func(base persistence.ExecutionManager, logger log.Logger) persistence.ExecutionManager {
// Wrap ExecutionManager with recorder to capture task writes
// This wraps the FINAL ExecutionManager after all FX processing (metrics, retries, etc.)
c.taskQueueRecorder = NewTaskQueueRecorder(base, logger)
return c.taskQueueRecorder
}),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this is the goal of this PR

}

// GetAllTasks returns all tasks grouped by category (unwrapped, without metadata)
func (r *TaskQueueRecorder) GetAllTasks() map[tasks.Category][]tasks.Task {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bunch of unused methods here ...

@@ -121,6 +125,13 @@ func (m *executionManagerImpl) CreateWorkflowExecution(
return nil, err
Copy link
Copy Markdown
Contributor Author

@stephanos stephanos Jun 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following lines are the main change ...

NumHistoryShards int32
Logger log.Logger
SharedCluster bool
EnableTaskQueueRecorder bool
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making it opt-in to not have to pay the cost for every test

@stephanos stephanos force-pushed the stephanos/history-tasks-written branch from 140bbd8 to 7ac0d31 Compare June 6, 2026 22:06
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.

1 participant