Skip to content
Latchkey

Shared State - CI/CD Glossary Definition

Shared state is mutable data reused across tests, and a common source of interference between them.

Shared state is data or resources (globals, singletons, a common database, files) accessed by multiple tests. Mutable shared state is a primary cause of flaky, order-dependent tests.

Read-only shared state (constants, fixtures) is safe. Mutable shared state must be reset between tests or scoped per test to preserve isolation.

In CI

Parallel runners multiply shared-state risk. A shared test database needs per-worker schemas or transactions rolled back after each test.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →