Skip to content

ate-setup: wait for ate-system namespace termination during teardown/… - #1851

Merged
Max Smythe (maxsmythe) merged 1 commit into
agent-substrate:mainfrom
chw120:fix-ate-system-namespace-termination
Sep 24, 2026
Merged

Max Smythe (maxsmythe) merged 1 commit into
agent-substrate:mainfrom
chw120:fix-ate-system-namespace-termination

Conversation

@chw120

Copy link
Copy Markdown
Collaborator

Problem

When orchestrator.py runs consecutive benchmark tests in Prow, teardown_substrate() runs hack/install-ate.sh --delete-ate-system (DeleteAteSystem), which previously returned immediately after issuing asynchronous deletion on the ate-system namespace without waiting for termination to complete.

Because draining atelet DaemonSets across 15 nodes and postgres takes ~60–65 seconds:

  1. The immediately following test runs deploy_substrate() (EnsureAteSystemNamespace) ~1 second later while namespace/ate-system is still Terminating.
  2. ApplyPath("ate-system-namespace.yaml") merely updates the terminating namespace object, and once the old namespace finishes deleting and transitions to NotFound, WaitNamespaceActive never re-applies the manifest and times out after 60s (waiting for namespace ate-system to become Active: context deadline exceeded).
  3. As a result, consecutive tests (such as the even-indexed *_pause M1 benchmarks) failed during deploy_substrate() in ~90% of Prow runs before Locust could start.

Fix

  • DeleteAteSystem (cmd/ate-setup/internal/steps/delete.go): Wait for namespace/<ns> deletion (WaitDeleted) to complete before returning from teardown.
  • EnsureAteSystemNamespace (cmd/ate-setup/internal/steps/env.go): If the target namespace already exists in Terminating phase when deploy starts, wait for it to finish deleting before applying ate-system-namespace.yaml / EnsureNamespace.

It's a good idea to open an issue first for discussion.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

@maxsmythe Max Smythe (maxsmythe) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

…deploy

When orchestrator runs consecutive benchmark tests, DeleteAteSystem
previously returned immediately after initiating deletion of the
ate-system namespace without waiting for termination to complete.
Because draining atelet DaemonSets and postgres takes ~60s, the
subsequent test's EnsureAteSystemNamespace often timed out waiting for
the Terminating namespace to become Active.

Wait for namespace/ate-system deletion in DeleteAteSystem and
EnsureAteSystemNamespace (as well as hack/install-ate.sh) so consecutive
benchmark deployments do not race with namespace termination.
@chw120
Chenyi Wang (chw120) force-pushed the fix-ate-system-namespace-termination branch from b1d1df6 to d404d67 Compare September 24, 2026 08:24
@maxsmythe
Max Smythe (maxsmythe) added this pull request to the merge queue Sep 24, 2026
Merged via the queue into agent-substrate:main with commit f3b5384 Sep 24, 2026
11 checks passed
@chw120
Chenyi Wang (chw120) deleted the fix-ate-system-namespace-termination branch September 24, 2026 17:39
@bowei Bowei Du (bowei) added area/dev-infra kind/bug Something isn't working / bugfixes labels Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dev-infra kind/bug Something isn't working / bugfixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants