Skip to content

test(e2e): stop racing the controller's own drain budget - #57

Open
agenticode wants to merge 1 commit into
mainfrom
fix/e2e-drain-budget
Open

agenticode wants to merge 1 commit into
mainfrom
fix/e2e-drain-budget

Conversation

@agenticode

Copy link
Copy Markdown
Owner

문제

e2e 잡이 최근 100회 중 34회 실패했다. 실패는 항상 같은 지점이다.

E2E FAIL: controller never removed a node
level=ERROR msg="step failed" step=3 type=delete-node err="context canceled"
plan executed ... done=2 failed=1 aborted=true

원인 — 테스트와 컨트롤러의 인내심이 같았다

예산
e2e.sh 4b 대기 60 x 5s = 300s
actuate.Config.NodeDrainTimeout 기본값 300s (pkg/actuate/actuate.go:71)

StepDeleteNodeWaitNodeEmpty 로 노드가 빌 때까지 최대 5분을 기다린다.
테스트도 정확히 5분을 기다린다. 두 시계가 같으니, 드레인이 즉시 끝나지 않는
순간부터는 누가 먼저 포기하느냐의 동전던지기가 된다. 테스트가 먼저 시작했으니
항상 테스트가 진다 — 컨트롤러를 드레인 도중에 죽여놓고 "노드를 안 지웠다"고 보고한다.

context canceled 는 원인이 아니라 정리(cleanup)가 컨트롤러를 죽인 결과다.

측정치가 이 해석과 일치한다:

  • 성공 런: 전체 스크립트 약 2분 10초 (드레인이 몇 초 만에 끝남)
  • 실패 런: 약 7분 20초 — 4b에서 300초를 통째로 소진한 뒤 실패

조치

  • 4b 대기를 10분으로 올린다. 최악의 드레인(5분) + 재조정 1회를 덮는다.
  • 60초마다 진행 상황을 찍어 10분이 침묵하는 정지처럼 보이지 않게 한다.
  • 타임아웃 시 노드/파드 상태를 덤프한다. 진짜 실패가 났을 때 "왜"를 남긴다.

제품 코드는 건드리지 않았다. 이건 테스트 하니스의 예산 충돌이다.

4b waited 60x5s = 5m for a node to disappear. The actuator's WaitNodeEmpty
gives the drain NodeDrainTimeout (default 5m) before it gives up, and only the
next reconcile retries. The two budgets were identical, so any drain that was
not near-instant became a coin flip: the test killed the controller mid-drain
and blamed it for "never removed a node".

Symptom in CI: ~1 run in 3 failed, always at 4b, always with step 3
delete-node err="context canceled" at the exact moment of teardown. Failing
runs sat the full 7m20s; green runs finished the whole script in ~2m10s.

Wait 10m instead, which covers a worst-case drain plus one retry, log progress
so the wait is not a silent stall, and dump node/pod state on timeout so a real
failure says why.

Co-authored-by: kording <74226694+kording@users.noreply.github.com>
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.

1 participant