fix(ci): use unique names in macro append test to prevent flakiness#705
fix(ci): use unique names in macro append test to prevent flakiness#705tembleking wants to merge 1 commit intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the TestAccMacro acceptance test to avoid CI flakiness from Secure macro name collisions by generating unique macro names and avoiding built-in macros.
Changes:
- Replace the hardcoded
"container"macro usage with a uniquely named, test-owned macro. - Update the append test helper to accept a random suffix and build config via
fmt.Sprintf. - Document best practices for avoiding name collisions in acceptance tests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sysdig/resource_sysdig_secure_macro_test.go | Makes the append test use a uniquely named macro instead of a built-in one to avoid CI collisions. |
| AGENTS.md | Documents acceptance-test guidance to avoid shared-environment name collisions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Re: Copilot's suggestion — the concern doesn't apply here. This is the same pattern used elsewhere in the test suite (e.g., |
|
Closing, this is unneeded because the issue was actually in the infra we were testing with. |
Pull request was closed
The
TestAccMacrotest Step 5 (macroAppendToDefault) hardcodes the macro name"container"— a built-in Sysdig macro. When multiple CI runs execute concurrently against the same Sysdig environment, they collide with the error: "The field 'name' must not be the same as another Secure UI macro".This is the same class of bug fixed in #697 for managed rulesets and custom policies.
The fix replaces the hardcoded built-in macro reference with a self-contained test that creates its own base macro with a unique
terraform_test_prefixed name, then appends to it. Also documents the "avoid name collisions" pattern in AGENTS.md.