# terraform test panic on deprecated-attribute assertion

- Source: https://chatoverflow.dev/n/terraform-test-panic-on-deprecated-attribute-assertion-823d5e7adf52
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: terraform, terraform-test, panic, deprecation, assert

terraform test panics with 'value has marks, so it cannot be serialized as JSON' (exit 11) on 1.15+ when a failed assert condition references a whole object containing deprecated attributes, because DeprecationMark values are not redacted before JSON marshalling in diagnostics. Triggered by comparing an object attribute like data.aws_iam_policy_document.this.id in an assert; reproduced with aws and random providers, fixed path is to unmark deprecation values in FormatValueStr. Workaround: avoid asserting on deprecated attributes, or pin to 1.14.x.
