hashicorp/terraform · critical
unrecognized test progress: %s
Error message
unrecognized test progress: %s
What it means
TestHuman.File (internal/command/views/test.go:155) switches over moduletest.Progress and panics 'unrecognized test progress' for any value outside Starting/Running/TearDown/Complete. moduletest.Progress is an iota enum (progress.go:14-18) with exactly those four members.
Source
Thrown at internal/command/views/test.go:161
} else {
t.view.streams.Println(".")
}
} else {
t.view.streams.Println()
}
}
func (t *TestHuman) File(file *moduletest.File, progress moduletest.Progress) {
switch progress {
case moduletest.Starting, moduletest.Running:
t.view.streams.Printf(t.view.colorize.Color("%s... [light_gray]in progress[reset]\n"), file.Name)
case moduletest.TearDown:
t.view.streams.Printf(t.view.colorize.Color("%s... [light_gray]tearing down[reset]\n"), file.Name)
case moduletest.Complete:
t.view.streams.Printf("%s... %s\n", file.Name, colorizeTestStatus(file.Status, t.view.colorize))
t.Diagnostics(nil, file, file.Diagnostics)
default:
panic("unrecognized test progress: " + progress.String())
}
}
func (t *TestHuman) Run(run *moduletest.Run, file *moduletest.File, progress moduletest.Progress, _ int64) {
switch progress {
case moduletest.Starting, moduletest.Running, moduletest.TearDown:
return // We don't print progress updates in human mode
case moduletest.Complete:
// Do nothing, the rest of the function handles this.
default:
panic("unrecognized test progress: " + progress.String())
}
t.view.streams.Printf(" run %q... %s\n", run.Name, colorizeTestStatus(run.Status, t.view.colorize))
if run.Verbose != nil {
// We're going to be more verbose about what we print, here's the plan
// or the state depending on the type of run we did.View on GitHub (pinned to d32a084675)
Solutions
- When adding a moduletest.Progress constant, update TestHuman.File (and the JSON/TestJSON variants and json.ToTestProgress) in the same change.
- Regenerate the stringer and add an exhaustive test over Progress values through the view layer.
- Guard upstream so Progress is never zero/unset before the view is called.
- As an end user this is an internal Terraform bug — report it with the 'terraform test' run details.
Defensive patterns
Strategy: validation
Validate before calling
func validProgress(p moduletest.Progress) bool {
switch p {
case moduletest.Starting, moduletest.Running, moduletest.TearDown, moduletest.Complete:
return true
}
return false
}
if !validProgress(progress) {
return fmt.Errorf("unsupported test progress %q", progress)
} Prevention
- When extending moduletest.Progress, update File/Run for both human and JSON views plus json.ToTestProgress in one change.
- Add an exhaustive test that feeds every Progress constant through the view layer.
- Never pass a zero-value Progress to the view; initialise it to Starting.
When it happens
Trigger: The test runner emits a moduletest.Progress value outside the four defined constants — only possible if a new Progress member is added (e.g. a 'Setup' phase) without updating this switch, or if a corrupted/zero-value Progress reaches the view.
Common situations: Extending the test lifecycle with a new progress phase and forgetting the human-view branch; an internal regression producing an uninitialised Progress.
Related errors
- unrecognized status: %s
- (*StateMigrateHuman)LogStateMigrationErrored: called incorre
- unknown view type %v
- unknown view type %v
- missing message for InstallingProviderMessage init message c
AI-assisted analysis of hashicorp/terraform@d32a084675 (2026-08-11).
Data as JSON: /api/errors/00195c666fc02672.
Report an issue: GitHub.