Skip to content

add functional tests for history_node cleanup#9931

Open
feiyang3cat wants to merge 2 commits intotemporalio:mainfrom
feiyang3cat:test/history_node_cleanup
Open

add functional tests for history_node cleanup#9931
feiyang3cat wants to merge 2 commits intotemporalio:mainfrom
feiyang3cat:test/history_node_cleanup

Conversation

@feiyang3cat
Copy link
Copy Markdown
Contributor

@feiyang3cat feiyang3cat commented Apr 13, 2026

What changed?

Add a functional test for history_node cleanup logic.

Why?

Verify so history_nodes are left in normal deletion process.

@feiyang3cat feiyang3cat requested review from a team as code owners April 13, 2026 17:55
@feiyang3cat feiyang3cat force-pushed the test/history_node_cleanup branch 3 times, most recently from e3b084e to c323827 Compare April 13, 2026 18:24
Comment thread tests/history_node_cleanup_test.go Outdated
// TestDeletionOfSingleWorkflow runs a single workflow, force-deletes it via the
// admin API, then asserts that all history_tree and history_node rows are removed.
func TestDeletionOfSingleWorkflow(t *testing.T) {
t.Parallel()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

check out #9536. We may want to use parallel suite to begin with, there's a list of functional tests in the diff that you can reference for newer guidelines

cc @stephanos

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💯 recommended to use parallelsuite here.

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.

updated

PageSize: 1000,
})
if err == nil {
env.Empty(resp.HistoryEvents, "history_node rows should be gone after deletion")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: imo error messages are more clear when they note what went wrong first, rather than the desired state.

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.

I think here shall be a state-based invariant as there can be too many ways things may go wrong and they don't exist now

@feiyang3cat feiyang3cat force-pushed the test/history_node_cleanup branch from c323827 to 5a165b0 Compare April 15, 2026 16:51
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.

3 participants