Performance tests need controlled workloads
Use representative data volume, indexes, engine settings, concurrency, and warm/cold cache expectations. Agree a baseline and measurable service objective before comparing builds.
- Separate correctness tests from load/stress experiments.
- Measure latency distribution, throughput, errors, CPU/I/O, locks, and connection-pool wait.
- Run a repeatable workload and record engine/version, dataset, configuration, and test duration.
- Set a stop condition and maximum load; use a dedicated environment.
- Investigate plan changes and workload mix before attributing a regression to a code change.
Do not enforce a brittle millisecond limit on a noisy shared CI runner. Keep stable budgets for controlled environments and monitor trends elsewhere.
Test access control and isolation
Create least-privilege test roles and assert allowed and denied operations. For multi-tenant data, create records for two tenants and verify every read, update, aggregate, and delete is scoped to the authenticated tenant. Test direct database permissions as well as application authorization.
-- Test with the application role in an isolated database:
SELECT has_table_privilege(
current_user,
'private_audit_log',
'SELECT'
) AS can_read_audit_log;
-- Assert false unless this role is explicitly allowed.Adapt privilege checks for your role model and database engine. Use synthetic credentials; never put production secrets into tests.
Test recovery, not only backup creation
For critical services, schedule an approved restore test on an isolated target. Verify schema, representative data, application smoke checks, measured recovery time, and the recoverable point. Preserve evidence and protect restored sensitive data. Do not test destructive recovery operations on the source production instance.
Operational test controls
- Use explicit resource and query timeouts.
- Keep performance test accounts and data separate from normal integration runs.
- Prevent a failed security test from silently granting broad permissions.
- Redact logs and artifacts; set retention for test outputs.
- Record environment, data size, tool version, thresholds, owner, and cleanup status.
Progress stays in this browser.