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

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
reviewtypo3org pushed a commit to TYPO3/typo3 that referenced this pull request Sep 16, 2026
This update includes performance improvements for
MySQL, MariaDB, PostgreSQL and SQLite.

TYPO3/testing-framework#754
TYPO3/testing-framework#745
TYPO3/testing-framework#744
TYPO3/testing-framework#743
TYPO3/testing-framework#742
TYPO3/testing-framework#741

For main the testing-framework is updated from its
`main` branch. The 14.3 backport raises it to `^9.7.0`,
which contains the same performance improvements. There
the constraint is raised for the composer based e2e
instance and the `typo3tests/dataset-import` test
package as well, which required `dev-main` so far.

Used command(s):

main:

> composer update typo3/testing-framework

14.3:

> composer require --dev "typo3/testing-framework:^9.7.0"

Resolves: #110717
Releases: main, 14.3
Change-Id: I2888587cd53acfc3e505ae4a1c643c218380d9c7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/95346
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
reviewtypo3org pushed a commit to TYPO3/typo3 that referenced this pull request Sep 16, 2026
This update includes performance improvements for
MySQL, MariaDB, PostgreSQL and SQLite.

TYPO3/testing-framework#754
TYPO3/testing-framework#745
TYPO3/testing-framework#744
TYPO3/testing-framework#743
TYPO3/testing-framework#742
TYPO3/testing-framework#741

For main the testing-framework is updated from its
`main` branch. The 14.3 backport raises it to `^9.7.0`,
which contains the same performance improvements. There
the constraint is raised for the composer based e2e
instance and the `typo3tests/dataset-import` test
package as well, which required `dev-main` so far.

Used command(s):

main:

> composer update typo3/testing-framework

14.3:

> composer require --dev "typo3/testing-framework:^9.7.0"

Resolves: #110717
Releases: main, 14.3
Change-Id: I2888587cd53acfc3e505ae4a1c643c218380d9c7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/95883
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
TYPO3IncTeam pushed a commit to TYPO3-CMS/core that referenced this pull request Sep 16, 2026
This update includes performance improvements for
MySQL, MariaDB, PostgreSQL and SQLite.

TYPO3/testing-framework#754
TYPO3/testing-framework#745
TYPO3/testing-framework#744
TYPO3/testing-framework#743
TYPO3/testing-framework#742
TYPO3/testing-framework#741

For main the testing-framework is updated from its
`main` branch. The 14.3 backport raises it to `^9.7.0`,
which contains the same performance improvements. There
the constraint is raised for the composer based e2e
instance and the `typo3tests/dataset-import` test
package as well, which required `dev-main` so far.

Used command(s):

main:

> composer update typo3/testing-framework

14.3:

> composer require --dev "typo3/testing-framework:^9.7.0"

Resolves: #110717
Releases: main, 14.3
Change-Id: I2888587cd53acfc3e505ae4a1c643c218380d9c7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/95346
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
TYPO3IncTeam pushed a commit to TYPO3-CMS/core that referenced this pull request Sep 16, 2026
This update includes performance improvements for
MySQL, MariaDB, PostgreSQL and SQLite.

TYPO3/testing-framework#754
TYPO3/testing-framework#745
TYPO3/testing-framework#744
TYPO3/testing-framework#743
TYPO3/testing-framework#742
TYPO3/testing-framework#741

For main the testing-framework is updated from its
`main` branch. The 14.3 backport raises it to `^9.7.0`,
which contains the same performance improvements. There
the constraint is raised for the composer based e2e
instance and the `typo3tests/dataset-import` test
package as well, which required `dev-main` so far.

Used command(s):

main:

> composer update typo3/testing-framework

14.3:

> composer require --dev "typo3/testing-framework:^9.7.0"

Resolves: #110717
Releases: main, 14.3
Change-Id: I2888587cd53acfc3e505ae4a1c643c218380d9c7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/95883
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
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