# What is a hermetic test?

> A hermetic test controls its data and dependencies for repeatable results. See how an overdue-notice test can use a real database and its own clock.

Source: https://cueapril.com/knowledge/definitions/hermetic-test
Updated: 2026-12-02
Index: https://cueapril.com/llms.txt

## What is a hermetic test?

A hermetic test controls its inputs and dependencies so that unrelated changes outside the test environment cannot alter its result. It can use real components, such as a database, provided the test controls their versions, starting data and interactions.

## Does creating a fresh environment make a test hermetic?

A fresh environment prevents some state from leaking between runs. It can still read today’s date or call a shared external service. Trace what the test actually reads. Pin changing dependencies, give the test its own data and supply a controllable clock where time affects the result.

## Worked example: Running an overdue-notice test on any day

Give the test its own empty database, add one loan due on Tuesday and advance its clock to Wednesday. Capture the notice using a test mail service. Another test can run beside it with a different loan and clock without affecting which notice is produced.

## Try it on your pull request

Choose a change in your repository and tell Cue April what should happen. Review the proposed checks before they run.

[Try Cue April on your repository](https://app.cueapril.com/sign-up/?next=%2Fquality-start)

## Related reading

- [Test double](https://cueapril.com/knowledge/definitions/test-double)

- [How to diagnose a flaky test](https://cueapril.com/knowledge/how-to/diagnose-a-flaky-test)

- [Test quarantine](https://cueapril.com/knowledge/definitions/test-quarantine)

[Browse the Knowledge base](https://cueapril.com/knowledge)
