Skip to content

testform taint

Ventana de terminal
testform [global options] taint [options] <address>

The testform taint command manually marks a managed resource instance as tainted in the state file. An instance marked this way is considered corrupted, partially failed, or in need of complete rebuilding.

During the next execution of testform apply, Testform will execute a replacement operation (-/+), destroying the current remote issue/entity and provisioning a fresh one from scratch.


  1. The comment stream on a GitHub Issue has become chaotic or corrupted and needs a clean slate.
  2. A remote test issue was altered out-of-band by an external automation tool.
  3. Immutable properties were updated that require recreating the entity.

Option Default Description
<address> (required) Canonical address or identity tag of the resource (e.g. "login.case.feature.@tc-1").
-allow-missing false If specified, the command succeeds (exit code 0) even if the resource is missing from state.
-lock=false true Do not hold a state lock during the operation.
-lock-timeout=0s 0s Duration to retry a state lock.
-state=path testform.state Path to the state file to use.

Ventana de terminal
# Mark resource instance as tainted
$ testform taint "login.case.feature.@tc-1"
Resource instance login.case.feature.@tc-1 has been marked as tainted.
# Run plan to verify planned replacement
$ testform plan
Testform will perform the following actions:
# login.case.feature.@tc-1 is tainted, so must be replaced
-/+ resource "testcase" "login_valid" {
~ id = 104 -> (known after apply)
}
Plan: 1 to add, 0 to change, 1 to destroy.

If you marked a resource by mistake, you can revert the action before running apply using the testform untaint command:

Ventana de terminal
$ testform untaint "login.case.feature.@tc-1"
Resource instance login.case.feature.@tc-1 has been successfully untainted.

  • 0: Taint status successfully recorded.
  • 1: Resource address was not found in the state ledger or failed to acquire state lock.