Skip to content

netresearch/typo3-testing-skill / skills/typo3-testing

typo3-testing

Flagged

Use when reproducing defects as failing tests, testing template or rendered output changes, confirming changes on a running TYPO3 instance, or setting up TYPO3 extension tests: unit/functional/E2E, PHPUnit 11-13, mutation testing, final-class mocks (v14), CI matrix across TYPO3 12/13/14.3 LTS, typo3-ci-workflows meta-package, CI failures. Also: transaction rollback, worker crashes, competing requests, testing-framework setup, test matrix, integration/e2e testing, coverage, test generation.

FileKindSize
SKILL.mdskill md6.8 KB
assets/.php-cs-fixer.dist.phpscript7.0 KB
assets/AGENTS.mdmarkdown5.0 KB
assets/Build/Scripts/runTests.shexecutablescript27.5 KB
assets/Build/playwright/.nvmrcother6 B
assets/Build/playwright/package.jsonmanifest535 B
assets/Build/playwright/playwright.config.tsscript1.3 KB
assets/Build/playwright/tests/playwright/accessibility/modules.spec.tsscript2.0 KB
assets/Build/playwright/tests/playwright/config.tsscript712 B
assets/Build/playwright/tests/playwright/e2e/backend-module.spec.tsscript1.9 KB
assets/Build/playwright/tests/playwright/fixtures/setup-fixtures.tsscript2.7 KB
assets/Build/playwright/tests/playwright/helper/login.setup.tsscript975 B
assets/FunctionalTests.xmlconfig1.4 KB
assets/FunctionalTestsBootstrap.phpscript1.6 KB
assets/Makefileother2.3 KB
assets/UnitTests.xmlconfig890 B
assets/UnitTestsBootstrap.phpscript2.1 KB
assets/bootstrap.phpscript1.4 KB
assets/codecov.ymlconfig1.6 KB
assets/docker/codeception.ymlconfig979 B
assets/docker/docker-compose.ymlconfig1.4 KB
assets/example-tests/ExampleAcceptanceCest.phpscript2.2 KB
assets/example-tests/ExampleFunctionalTest.phpscript2.4 KB
assets/example-tests/ExampleUnitTest.phpscript1.6 KB
assets/fixtures/README.mdmarkdown2.0 KB
assets/fixtures/be_users.csvother361 B
assets/fixtures/pages.csvother257 B
assets/fixtures/sys_category.csvother228 B
assets/fixtures/tt_content.csvother338 B
assets/github-actions-e2e.ymlconfig8.8 KB
assets/github-actions-tests.ymlconfig6.3 KB
assets/infection.json5other2.8 KB
assets/phpat.neonother330 B
assets/phpat.phpscript8.4 KB
assets/phpstan-baseline.neonother365 B
assets/phpstan.neonother1.4 KB
assets/rector.phpscript2.9 KB
checkpoints.yamlconfig61.7 KB
references/accessibility-testing.mdmarkdown7.6 KB
references/architecture-testing.mdmarkdown4.4 KB
references/asset-templates-guide.mdmarkdown3.4 KB
references/backend-module-render-verification.mdmarkdown9.7 KB
references/backend-user-access-testing.mdmarkdown9.5 KB
references/captainhook-setup.mdmarkdown2.4 KB
references/ci-cd.mdmarkdown39.5 KB
references/ci-debugging.mdmarkdown20.0 KB
references/ci-workflows-meta-package.mdmarkdown11.6 KB
references/crash-and-concurrency-testing.mdmarkdown4.8 KB
references/crypto-testing.mdmarkdown16.6 KB
references/datahandler-silent-rewrites.mdmarkdown7.2 KB
references/ddev-testing.mdmarkdown1.3 KB
references/e2e-testing.mdmarkdown53.0 KB
references/enforcement-rules.mdmarkdown5.7 KB
references/event-dispatch-testing.mdmarkdown2.8 KB
references/framework-compat-gate.mdmarkdown4.9 KB
references/functional-test-patterns.mdmarkdown11.0 KB
references/functional-testing.mdmarkdown46.3 KB
references/fuzz-testing.mdmarkdown8.6 KB
references/integration-testing.mdmarkdown14.1 KB
references/javascript-testing.mdmarkdown29.3 KB
references/live-instance-verification.mdmarkdown8.6 KB
references/mock-validity.mdmarkdown15.7 KB
references/mutation-testing.mdmarkdown36.0 KB
references/performance-testing.mdmarkdown11.2 KB
references/quality-tools.mdmarkdown25.5 KB
references/release-workflow-validation.mdmarkdown3.6 KB
references/sonarcloud.mdmarkdown18.8 KB
references/synthetic-secret-fixtures.mdmarkdown3.8 KB
references/tdd-discipline.mdmarkdown9.1 KB
references/test-environment-guards.mdmarkdown18.5 KB
references/test-runners.mdmarkdown24.6 KB
references/typo3-ci-config-patterns.mdmarkdown9.0 KB
references/typo3-v14-final-classes.mdmarkdown16.5 KB
references/unit-testing.mdmarkdown59.1 KB
scripts/generate-test.shexecutablescript6.0 KB
scripts/setup-testing.shexecutablescript6.3 KB
scripts/validate-setup.shexecutablescript4.0 KB

references/crash-and-concurrency-testing.md

View on GitHub
<!-- SPDX-License-Identifier: CC-BY-SA-4.0 -->
<!-- SPDX-FileCopyrightText: Netresearch DTT GmbH -->

# Crash and Concurrency Testing

Use this guide when a TYPO3 extension claims atomic writes, crash recovery or
correctness across overlapping requests. Ordinary logic fixes still use the
normal [TDD loop](tdd-discipline.md); they do not require a formal model.

## Choose the Claim and Persistence Boundary

Name the invariant, participating tables, connection and commit owner. For an
audited mutation, include the value, MM relations, audit row and integrity anchor
where the contract requires them to commit together. Assert stored state through
a fresh reader, not only calls on a transaction mock.

Resolve the connections actually used by the services. TYPO3 table mappings can
route writes to different connections; a transaction on one does not protect the
others. Test rejection of unsupported split mappings or enclosing transactions
if the implementation requires sole ownership. Releasing a savepoint is not an
outer commit, and locks must cover the final commit that makes writes visible.
Also test the supported successful path; rejecting every request is not atomicity.

Use the database engine and isolation level relevant to the claim. SQLite is
useful for a local persistence probe, but its passing result does not establish
MySQL/PostgreSQL locking behavior. Document the actual backend and configuration.
Listener database writes participate only if they use the same transaction.
Check external cache invalidations, emitted events and remote audit sinks
separately; a database rollback does not reverse those effects.

## Distinguish an Exception from Process Loss

An injected exception exercises catch/finally and compensation. Keep that test
for handled failures, then use a separate worker for abrupt termination:

1. Give the worker its own connection to the shared test database. Do not use a
   private `:memory:` database or a parent test transaction invisible to it.
2. Let the real writer signal after the relevant statement and before the next
   persistence step. Publish a complete marker atomically or use an IPC barrier;
   a fixed sleep is not evidence that the worker reached the boundary.
3. Bound the wait, reject bootstrap failure and require the worker to be alive
   before injecting process loss. On POSIX, verify the `SIGKILL` termination
   status. On other platforms record the actual termination mechanism and limits.
4. Reopen the database after the worker exits and assert the invariant, including
   durable related rows. Do not accept any nonzero exit as proof of a crash test.
5. Terminate remaining workers and clean up temporary state even if assertions
   fail. Keep the original failing run or a deliberately broken control.

If the guarantee covers every committed mutation, retain and inspect history.
After interrupting request A, let request B succeed and verify that A has not
become an unaudited committed version hidden behind B's correctly audited value.
A final-state assertion on B alone misses that failure.

## Coordinate Overlapping Requests

Use two requests with separate connections and observable barriers around the
contested boundary. Hold A at that boundary, start B and establish that B reached
its attempted write or lock acquisition; then release A. Bound both waits and
database lock timeouts, and propagate worker failures to the test process.

Assert the allowed durable outcomes and audit association for both requests.
Include failure of A after B succeeds when compensation could restore stale
state over B's committed value. Check that locks remain owned until the actual
outer commit, not merely a helper return or savepoint release. Avoid assertions
based solely on call order or a lucky scheduler interleaving.

## Report the Evidence at Its Actual Scope

Record the implementation revision, backend, tested boundary/interleaving,
commands and outcomes. Report unexecuted configurations as unverified. Run the
extension's functional suite through `Build/Scripts/runTests.sh -s functional`
with its required PHP/database settings; the repository's CI is authoritative.

A finite model can help explore orderings when that specific guarantee needs
it. Validate intended counterexamples and reachable successful operations, then
translate useful traces into implementation tests when that work is in scope.
Report model assumptions and bounds separately from runtime results; neither a
green model nor these tests provide a refinement proof of the PHP implementation.

## Sources

- [TYPO3 ConnectionPool and table mappings](https://api.typo3.org/main/classes/TYPO3-CMS-Core-Database-ConnectionPool.html)
- [Doctrine DBAL transaction nesting](https://www.doctrine-project.org/projects/doctrine-dbal/en/4.3/reference/transactions.html#transaction-nesting)
- [Python process termination and return codes](https://docs.python.org/3/library/subprocess.html#subprocess.Popen.kill)
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall