Repository navigation
Delete functional test resources in dependency order to fix LRT - #12702
Conversation
Test_RadiusCore_AzureMySql_PortalLink has failed every scheduled long-running test run since July 10. The failure is in the cleanup phase: `rad application delete` fails with an Internal error wrapping a 404 on the test's environment. The test declared its RPResources as recipe pack, environment, application, database. Cleanup deleted them in that order, so by the time the application was deleted its environment and recipe pack were already gone. Deleting the application cascades into the Radius.Data/mySqlDatabases resource, whose delete loads the environment configuration to run the recipe's destroy, so that lookup returned NotFound and the delete failed. The bug was invisible in pull request CI because the cloud and non-cloud functional test workflows set RADIUS_TEST_FAST_CLEANUP=true, which issues deletions in background goroutines and discards their errors. The long-running test runs against a persistent cluster and uses standard cleanup, so it is the only suite that exercises the failing path. Reorder that test's resources, and sort resources into dependency order during teardown so declaration order can no longer cause this: applications first, then application-scoped resources, then environments, then recipe packs. Declaration order is preserved within each group. A nil resource set now yields no resources instead of panicking. Correct the functional test documentation, which claimed cloud tests always use standard cleanup, and document the deletion order. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 96688135-b4f9-4f97-aac0-d8487b109bb3 Signed-off-by: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12702 +/- ##
==========================================
- Coverage 54.41% 54.41% -0.01%
==========================================
Files 770 770
Lines 51371 51371
==========================================
- Hits 27955 27953 -2
- Misses 20799 20800 +1
- Partials 2617 2618 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 96688135-b4f9-4f97-aac0-d8487b109bb3 Signed-off-by: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com>
The temporary standard-cleanup validation confirmed Test_RadiusCore_AzureMySql_PortalLink passes. Restore the CI default after validation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 96688135-b4f9-4f97-aac0-d8487b109bb3 Signed-off-by: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com>
The LRT executes tests from the current release, so skip the test until a release includes the dependency-ordered cleanup fix. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 96688135-b4f9-4f97-aac0-d8487b109bb3 Signed-off-by: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com>
Radius functional test overviewClick here to see the test run details
Test Status⌛ Building Radius and pushing container images for functional tests... |
There was a problem hiding this comment.
Pull request overview
Fixes long-running test (LRT) cleanup failures by ensuring functional-test resource teardown happens in a dependency-safe order (apps/resources before environments/recipe packs), and documents the behavior so CI vs LRT cleanup differences are clear.
Changes:
- Introduces
validation.ResourcesInDeletionOrderand uses it during cleanup to delete applications first, then app-scoped resources, then environments, then recipe packs (stable within each group). - Reorders the MySQL portal-link functional test’s declared cleanup resources to align with dependency-ordered teardown.
- Adds unit tests, updates functional-test cleanup documentation, and temporarily skips the released LRT version of the affected test until a fixed release is available.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
test/validation/shared.go |
Adds teardown ranking + ResourcesInDeletionOrder helper to enforce dependency-ordered deletions. |
test/validation/shared_test.go |
Adds table-driven unit coverage for ordering behavior and non-mutation of inputs. |
test/rp/rptest.go |
Uses ResourcesInDeletionOrder(step.RPResources) during cleanup, making nil RPResources safe and enforcing teardown order. |
test/functional-portable/corerp/cloud/resources/radiuscore_azure_mysql_portallink_test.go |
Reorders resource declarations so app/db delete precedes environment/recipe pack deletion. |
docs/contributing/contributing-code/contributing-code-tests/running-functional-tests.md |
Clarifies fast-cleanup behavior and documents dependency-ordered teardown. |
.github/workflows/long-running-azure.yaml |
Temporarily extends released-suite skip list to include the affected test until a fixed release is cut. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
….1 (#12831) Patch release `v0.60.1` for channel `0.60`. ## Backported PRs Listed in cherry-pick (topological) order. **Gap filler** = not requested for the patch, but included because it touched the same region of a shared file between `release/0.60` and a requested commit. Without it the cherry-pick has no common merge base and conflicts. | # | Commit | PR | Role | | --- | --- | --- | --- | | 1 | `6882b5fdf` | #12640 | Requested | | 2 | `af0443809` | #12721 | Requested | | 3 | `7c6de043d` | #12733 | **Gap filler** — `.github/workflows/codeql.yml` | | 4 | `ca7b5a3e7` | #12728 | Requested | | 5 | `2eac7c1f1` | #12702 | Requested | | 6 | `b4ebe2f28` | #12751 | Requested | | 7 | `e30a2594d` | #12727 | Requested | | 8 | `3c7dfecd6` | #12769 | **Gap filler** — `.github/workflows/codeql.yml` | | 9 | `787b6ca1a` | #12765 | **Gap filler** — `build/test.mk` | | 10 | `f84184955` | #12775 | Requested | | 11 | `415d5b9c2` | #12779 | Requested | | 12 | `a1d976013` | #12782 | Requested | | 13 | `14a21bd0d` | #12786 | **Gap filler** — `build/test.mk` | | 14 | `a87146c77` | #12764 | **Gap filler** — `build/test.mk` | | 15 | `073ca3cfa` | #12758 | Requested | | 16 | `5e1f94c13` | #12785 | **Gap filler** — `pkg/cli/cmd/install/kubernetes/kubernetes.go` | | 17 | `1fd650af5` | #12742 | Requested | | 18 | `19376c3f3` | #12829 | Requested | Five of the six gap fillers are CI/test-only. #12785 is not: it adds a Helm `control-plane-readiness` Job, a `pre-upgrade wait-for-control-plane` command, UCP readiness probes, and a NetworkPolicy change. It is required for #12829 to apply. ## Validation Full chain dry-run cherry-picked onto `release/0.60` with zero conflicts. `go build ./...` clean; `pkg/cli/cmd/install/kubernetes`, `cmd/pre-upgrade/cmd`, `pkg/cli/...`, `pkg/graph/...`, and `test/validation` all pass. --------- Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
# Description `Test_RadiusCore_AzureMySql_PortalLink` fails in the scheduled long-running test (LRT) during cleanup because the test deletes its environment and recipe pack before deleting the application. Application deletion cascades into the recipe-backed `Radius.Data/mySqlDatabases` resource, whose delete operation still needs the environment configuration to run `terraform destroy`; the missing environment produces an `Internal` error wrapping `NotFound`. ## Why pull request CI did not catch it The cloud and non-cloud functional workflows set `RADIUS_TEST_FAST_CLEANUP=true`, which starts deletion in background goroutines and discards their errors. The LRT uses standard cleanup on a persistent cluster and therefore surfaces the failure. The LRT also executes tests from the current official release rather than `main`, so the released test must be temporarily skipped until a release includes this fix. ## Changes - Reorder the MySQL portal-link test resources so the application and database are deleted before the environment and recipe pack. - Add `validation.ResourcesInDeletionOrder`, which orders teardown as applications, application-scoped resources, environments, then recipe packs while preserving declaration order within each group. - Make cleanup safe when a test step has a nil resource set. - Add table-driven unit coverage for ordering, stable groups, case-insensitive type matching, nil and empty inputs, unknown resource types, and input preservation. - Correct the functional-test cleanup documentation and document dependency-ordered teardown. - Skip `Test_RadiusCore_AzureMySql_PortalLink` in the released LRT suite until a release contains the fix. ## Validation - The target test passed with `RADIUS_TEST_FAST_CLEANUP=false` in 271 seconds. That cloud run later failed only on unrelated AWS deletion assertions: https://github.com/radius-project/radius/actions/runs/32422259142 - The complete branch LRT against v0.60 succeeded with the temporary released-test skip, including diagnostics and persistent-cluster cleanup: https://github.com/radius-project/radius/actions/runs/32425245273 - Unit tests, lint, builds, CodeQL, dependency review, and the remaining functional suites pass. - The latest `corerp-cloud` run and its failed-job rerun were red only because the unrelated `Test_AWS_LogsLogGroup` AWS deletion waiter reported an already-absent resource as still present; neither failure involved the MySQL portal-link test or the changed cleanup ordering. ## Type of change - This pull request fixes a bug in Radius and has an approved issue (#12701). Fixes: #12701 ## Contributor checklist - [x] Existing functional tests updated as required by this change. - [x] Unit tests added for the cleanup-order helper. - [x] Contributor documentation updated. - [x] The standard-cleanup path and released LRT workflow validated. --------- Signed-off-by: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 96688135-b4f9-4f97-aac0-d8487b109bb3 (cherry picked from commit 2eac7c1) Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
….1 (#12831) Patch release `v0.60.1` for channel `0.60`. ## Backported PRs Listed in cherry-pick (topological) order. **Gap filler** = not requested for the patch, but included because it touched the same region of a shared file between `release/0.60` and a requested commit. Without it the cherry-pick has no common merge base and conflicts. | # | Commit | PR | Role | | --- | --- | --- | --- | | 1 | `6882b5fdf` | #12640 | Requested | | 2 | `af0443809` | #12721 | Requested | | 3 | `7c6de043d` | #12733 | **Gap filler** — `.github/workflows/codeql.yml` | | 4 | `ca7b5a3e7` | #12728 | Requested | | 5 | `2eac7c1f1` | #12702 | Requested | | 6 | `b4ebe2f28` | #12751 | Requested | | 7 | `e30a2594d` | #12727 | Requested | | 8 | `3c7dfecd6` | #12769 | **Gap filler** — `.github/workflows/codeql.yml` | | 9 | `787b6ca1a` | #12765 | **Gap filler** — `build/test.mk` | | 10 | `f84184955` | #12775 | Requested | | 11 | `415d5b9c2` | #12779 | Requested | | 12 | `a1d976013` | #12782 | Requested | | 13 | `14a21bd0d` | #12786 | **Gap filler** — `build/test.mk` | | 14 | `a87146c77` | #12764 | **Gap filler** — `build/test.mk` | | 15 | `073ca3cfa` | #12758 | Requested | | 16 | `5e1f94c13` | #12785 | **Gap filler** — `pkg/cli/cmd/install/kubernetes/kubernetes.go` | | 17 | `1fd650af5` | #12742 | Requested | | 18 | `19376c3f3` | #12829 | Requested | Five of the six gap fillers are CI/test-only. #12785 is not: it adds a Helm `control-plane-readiness` Job, a `pre-upgrade wait-for-control-plane` command, UCP readiness probes, and a NetworkPolicy change. It is required for #12829 to apply. ## Validation Full chain dry-run cherry-picked onto `release/0.60` with zero conflicts. `go build ./...` clean; `pkg/cli/cmd/install/kubernetes`, `cmd/pre-upgrade/cmd`, `pkg/cli/...`, `pkg/graph/...`, and `test/validation` all pass. --------- Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com> (cherry picked from commit e5938bf) Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
# Description `Test_RadiusCore_AzureMySql_PortalLink` fails in the scheduled long-running test (LRT) during cleanup because the test deletes its environment and recipe pack before deleting the application. Application deletion cascades into the recipe-backed `Radius.Data/mySqlDatabases` resource, whose delete operation still needs the environment configuration to run `terraform destroy`; the missing environment produces an `Internal` error wrapping `NotFound`. ## Why pull request CI did not catch it The cloud and non-cloud functional workflows set `RADIUS_TEST_FAST_CLEANUP=true`, which starts deletion in background goroutines and discards their errors. The LRT uses standard cleanup on a persistent cluster and therefore surfaces the failure. The LRT also executes tests from the current official release rather than `main`, so the released test must be temporarily skipped until a release includes this fix. ## Changes - Reorder the MySQL portal-link test resources so the application and database are deleted before the environment and recipe pack. - Add `validation.ResourcesInDeletionOrder`, which orders teardown as applications, application-scoped resources, environments, then recipe packs while preserving declaration order within each group. - Make cleanup safe when a test step has a nil resource set. - Add table-driven unit coverage for ordering, stable groups, case-insensitive type matching, nil and empty inputs, unknown resource types, and input preservation. - Correct the functional-test cleanup documentation and document dependency-ordered teardown. - Skip `Test_RadiusCore_AzureMySql_PortalLink` in the released LRT suite until a release contains the fix. ## Validation - The target test passed with `RADIUS_TEST_FAST_CLEANUP=false` in 271 seconds. That cloud run later failed only on unrelated AWS deletion assertions: https://github.com/radius-project/radius/actions/runs/32422259142 - The complete branch LRT against v0.60 succeeded with the temporary released-test skip, including diagnostics and persistent-cluster cleanup: https://github.com/radius-project/radius/actions/runs/32425245273 - Unit tests, lint, builds, CodeQL, dependency review, and the remaining functional suites pass. - The latest `corerp-cloud` run and its failed-job rerun were red only because the unrelated `Test_AWS_LogsLogGroup` AWS deletion waiter reported an already-absent resource as still present; neither failure involved the MySQL portal-link test or the changed cleanup ordering. ## Type of change - This pull request fixes a bug in Radius and has an approved issue (#12701). Fixes: #12701 ## Contributor checklist - [x] Existing functional tests updated as required by this change. - [x] Unit tests added for the cleanup-order helper. - [x] Contributor documentation updated. - [x] The standard-cleanup path and released LRT workflow validated. --------- Signed-off-by: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 96688135-b4f9-4f97-aac0-d8487b109bb3 (cherry picked from commit 2eac7c1) Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
….1 (#12831) Patch release `v0.60.1` for channel `0.60`. ## Backported PRs Listed in cherry-pick (topological) order. **Gap filler** = not requested for the patch, but included because it touched the same region of a shared file between `release/0.60` and a requested commit. Without it the cherry-pick has no common merge base and conflicts. | # | Commit | PR | Role | | --- | --- | --- | --- | | 1 | `6882b5fdf` | #12640 | Requested | | 2 | `af0443809` | #12721 | Requested | | 3 | `7c6de043d` | #12733 | **Gap filler** — `.github/workflows/codeql.yml` | | 4 | `ca7b5a3e7` | #12728 | Requested | | 5 | `2eac7c1f1` | #12702 | Requested | | 6 | `b4ebe2f28` | #12751 | Requested | | 7 | `e30a2594d` | #12727 | Requested | | 8 | `3c7dfecd6` | #12769 | **Gap filler** — `.github/workflows/codeql.yml` | | 9 | `787b6ca1a` | #12765 | **Gap filler** — `build/test.mk` | | 10 | `f84184955` | #12775 | Requested | | 11 | `415d5b9c2` | #12779 | Requested | | 12 | `a1d976013` | #12782 | Requested | | 13 | `14a21bd0d` | #12786 | **Gap filler** — `build/test.mk` | | 14 | `a87146c77` | #12764 | **Gap filler** — `build/test.mk` | | 15 | `073ca3cfa` | #12758 | Requested | | 16 | `5e1f94c13` | #12785 | **Gap filler** — `pkg/cli/cmd/install/kubernetes/kubernetes.go` | | 17 | `1fd650af5` | #12742 | Requested | | 18 | `19376c3f3` | #12829 | Requested | Five of the six gap fillers are CI/test-only. #12785 is not: it adds a Helm `control-plane-readiness` Job, a `pre-upgrade wait-for-control-plane` command, UCP readiness probes, and a NetworkPolicy change. It is required for #12829 to apply. ## Validation Full chain dry-run cherry-picked onto `release/0.60` with zero conflicts. `go build ./...` clean; `pkg/cli/cmd/install/kubernetes`, `cmd/pre-upgrade/cmd`, `pkg/cli/...`, `pkg/graph/...`, and `test/validation` all pass. --------- Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com> (cherry picked from commit e5938bf) Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Description
Test_RadiusCore_AzureMySql_PortalLinkfails in the scheduled long-running test (LRT) during cleanup because the test deletes its environment and recipe pack before deleting the application. Application deletion cascades into the recipe-backedRadius.Data/mySqlDatabasesresource, whose delete operation still needs the environment configuration to runterraform destroy; the missing environment produces anInternalerror wrappingNotFound.Why pull request CI did not catch it
The cloud and non-cloud functional workflows set
RADIUS_TEST_FAST_CLEANUP=true, which starts deletion in background goroutines and discards their errors. The LRT uses standard cleanup on a persistent cluster and therefore surfaces the failure. The LRT also executes tests from the current official release rather thanmain, so the released test must be temporarily skipped until a release includes this fix.Changes
validation.ResourcesInDeletionOrder, which orders teardown as applications, application-scoped resources, environments, then recipe packs while preserving declaration order within each group.Test_RadiusCore_AzureMySql_PortalLinkin the released LRT suite until a release contains the fix.Validation
RADIUS_TEST_FAST_CLEANUP=falsein 271 seconds. That cloud run later failed only on unrelated AWS deletion assertions: https://github.com/radius-project/radius/actions/runs/32422259142corerp-cloudrun and its failed-job rerun were red only because the unrelatedTest_AWS_LogsLogGroupAWS deletion waiter reported an already-absent resource as still present; neither failure involved the MySQL portal-link test or the changed cleanup ordering.Type of change
Fixes: #12701
Contributor checklist