Skip to content

fix: clean up stale custom domains before acceptance test#149

Merged
KT-Doan merged 1 commit intomainfrom
fix/custom-domain-test-cleanup
Mar 24, 2026
Merged

fix: clean up stale custom domains before acceptance test#149
KT-Doan merged 1 commit intomainfrom
fix/custom-domain-test-cleanup

Conversation

@KT-Doan
Copy link
Copy Markdown
Collaborator

@KT-Doan KT-Doan commented Mar 23, 2026

Description

Add pre-test cleanup for custom domain acceptance tests. When a previous test run fails mid-step, the custom domain CNAME is left on the smoke test project, causing subsequent runs to fail with "Duplicate custom hostname found (1406)".

The cleanupStaleCustomDomains() function runs during PreCheck and deletes any existing custom domains from the test project before the test creates new ones.

Related Issues

closes #148

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING guide
  • My code follows the existing code style
  • I have added tests that prove my fix/feature works
  • I have updated documentation as needed
  • All new and existing tests pass (make test)
  • I have run the linter (make format)

Testing

  • Unit tests
  • Acceptance tests
  • Manual testing

Acceptance test output

=== RUN   TestAccCustomDomainResource_basic
--- PASS: TestAccCustomDomainResource_basic (14.13s)
PASS

The custom domain acceptance test fails with "Duplicate custom hostname
found (1406)" when a previous test run failed before its destroy step
could clean up the CNAME. Add a pre-test cleanup that deletes any
existing custom domains from the test project before creating new ones.
Copilot AI review requested due to automatic review settings March 23, 2026 11:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a pre-check cleanup step for custom domain acceptance tests to prevent failures caused by leftover (stale) custom domains from interrupted prior runs.

Changes:

  • Introduce cleanupStaleCustomDomains() helper to delete existing custom domains in the test project.
  • Call the cleanup helper from testAccPreCheckCustomDomain.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@KT-Doan KT-Doan self-assigned this Mar 23, 2026
@KT-Doan KT-Doan merged commit 001909b into main Mar 24, 2026
14 checks passed
@KT-Doan KT-Doan deleted the fix/custom-domain-test-cleanup branch March 24, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom domain acceptance test fails with duplicate hostname after failed test run

3 participants