# Troubleshooting

> Common trimtest problems and fixes, from everything running to ignored recordings and stale Gradle builds.

## Everything runs when I changed one file

That is deliberate when trimtest cannot trace the change. Run `trimtest select` and read the reason. The usual
causes: no baseline yet, a lockfile or build config changed, a deleted file nothing depends on, or `--strict`. See
[Safety rules](/concepts/safety-rules/).

## `record --run` says "tests failed; baseline not recorded"

`record --run` only records a baseline from a green run. Fix the failing tests, or use `record --coverage --lenient`
to tolerate units that cannot be measured.

## A test I expected is not selected

```bash
trimtest explain tests/test_core.py
```

prints every reason and the evidence tier, or says why nothing selected it. If a dependency is invisible to the
import graph (reflection, string-based imports), record coverage so it is measured: `trimtest record --coverage`.
For suites with no import link at all, add a `[map]` entry.

## My recording is ignored

A recording is ignored, and the test uses the static graph, when the test file changed since it was made, when the
coverage tool version changed, or when you compare against another `--base` (a warning says so). Re-record with
`trimtest record --coverage`.

## Exit code 3

Selection is uncertain: a selected test cannot be run by the runner. Run the full suite (`trimtest run --full`)
and check which test was skipped in the warning above the summary. `trimtest select --exit-code` also exits `3`
when nothing is selected but a changed file is not known to affect any test.

## The baseline looks old

trimtest warns when the recorded baseline is far behind `HEAD`. Re-baseline with `trimtest record --update-if-green`
(runs the affected tests and re-records only if they pass).

## Validate the config

```bash
trimtest check
```

Errors name the file and the key. Unknown keys are errors, and top-level keys must come before the first `[table]`.

## Gradle runs stale classes

trimtest already passes `-Dorg.gradle.vfs.watch=false`. If you run Gradle yourself right after an edit and tests pass
when they should fail, that is Gradle's file watcher; see [Java and Kotlin](/languages/jvm/#gradle-file-watching).

## Windows

Supported natively; see the [Windows guide](/guides/windows/). Common problems: a `.cmd` shim rejecting
an argument, paths over 260 characters (`git config --system core.longpaths true`), or antivirus locking
`.trimtest\map.json`. WSL also works and behaves like Linux.
