Flakey test: `TestApply_PolicyResultsJSON_WithSavedPlan`
Author: SarahFrenchCreated Sep 25, 2026Updated Sep 25, 2026
Labelstests
Example from https://github.com/hashicorp/terraform/actions/runs/36134431221/job/108068990882?pr=39282
--- FAIL: TestApply_PolicyResultsJSON_WithSavedPlan (0.04s)
apply_policy_test.go:278: wrong output lines
[]map[string]any{
{"@level": string("info"), "@message": string("test_instance.foo: Plan to create"), "@module": string("terraform.ui"), "change": map[string]any{"action": string("create"), "resource": map[string]any{"addr": string("test_instance.foo"), "implied_provider": string("test"), "module": string(""), "resource": string("test_instance.foo"), ...}}, ...},
{"@level": string("info"), "@message": string("test_instance.foo: Creating..."), "@module": string("terraform.ui"), "hook": map[string]any{"action": string("create"), "resource": map[string]any{"addr": string("test_instance.foo"), "implied_provider": string("test"), "module": string(""), "resource": string("test_instance.foo"), ...}}, ...},
{
"@level": string("info"),
"@message": strings.Join({
"test_instance.foo: Creation complete after ",
- "0",
+ "1",
"s",
}, ""),
"@module": string("terraform.ui"),
"hook": map[string]any{
"action": string("create"),
- "elapsed_seconds": float64(0),
+ "elapsed_seconds": float64(1),
"resource": map[string]any{"addr": string("test_instance.foo"), "implied_provider": string("test"), "module": string(""), "resource": string("test_instance.foo"), ...},
},
"type": string("apply_complete"),
},
{"@level": string("error"), "@message": string("Error: policy denied"), "@module": string("terraform.ui"), "@policy": string("true"), ...},
{"@level": string("info"), "@message": string("Policy Result"), "@module": string("terraform.ui"), "@policy": string("true"), ...},
... // 2 identical elements
}
NOTE: This failure may indicate a UI change affecting the behavior of structured run output on TFC.
Please communicate with HCP Terraform team before resolving
FAIL
Source: hashicorp/terraform