Skip to content

[TASK] Speed up PostgreSQL functional database resets - #742

Merged
sbuerk merged 1 commit into
TYPO3:mainfrom
wouter90:optimize-postgres-functional-reset
Sep 4, 2026
Merged

[TASK] Speed up PostgreSQL functional database resets#742
sbuerk merged 1 commit into
TYPO3:mainfrom
wouter90:optimize-postgres-functional-reset

Conversation

@wouter90

Copy link
Copy Markdown
Contributor

Functional tests currently truncate every PostgreSQL table separately and query its sequence before resetting it. This creates dozens of round trips between test methods even when the database is small.\n\nUse PostgreSQL's native multi-table TRUNCATE with RESTART IDENTITY and CASCADE. This preserves the existing cleanup semantics while reducing the reset to schema discovery plus one statement.\n\nA representative 66-test class improves from a median 11.782 seconds to 5.149 seconds (56.3%).

Functional tests currently truncate every PostgreSQL table separately and query its sequence before resetting it. This creates dozens of round trips between test methods even when the database is small.\n\nUse PostgreSQL's native multi-table TRUNCATE with RESTART IDENTITY and CASCADE. This preserves the existing cleanup semantics while reducing the reset to schema discovery plus one statement.\n\nA representative 66-test class improves from a median 11.782 seconds to 5.149 seconds (56.3%).
@sbuerk
sbuerk force-pushed the optimize-postgres-functional-reset branch from 9584128 to e2f173c Compare September 4, 2026 12:43
@sbuerk
sbuerk merged commit 4c26e8e into TYPO3:main Sep 4, 2026
4 checks passed
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