Skip to content

fix(e2e): inject boothook write_files at line boundary to avoid splitting nohup launcher - #10010

Closed
suyadav1 wants to merge 2 commits into
mainfrom
suyadav-microsoft-fix-boothook-nohup-injection
Closed

suyadav1 wants to merge 2 commits into
mainfrom
suyadav-microsoft-fix-boothook-nohup-injection

Conversation

@suyadav1

@suyadav1 suyadav1 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

What

Fix injectWriteFilesEntriesToBoothookCustomData in the e2e harness. It was splicing the CustomDataWriteFiles block into the middle of a line in the cloud-boothook.

Why

The function inserted the block at the index of /bin/bash /opt/azure/containers/aks-node-controller-launcher.sh. That position is right after nohup on the same line, so the rendered boothook became:

	nohup <write_files block>
/bin/bash /opt/azure/containers/aks-node-controller-launcher.sh > ... &

The boothook then fails with nohup: missing operand (seen in the serial console), so aks-node-controller never runs.

Because of this, Test_Ubuntu2204_PreProvision_CustomCAFailure has been failing on every Linux PR gate since ~11-05. The VMSS create times out (~1039s) instead of CSE exiting with the expected status 161. Examples: #9736, #10002–#10009, #9998, #9966, #9833.

How

  • Insert at the start of the line for the top-level logger -t aks-boothook "launching aks-node-controller ..." line, which precedes the launcher if/else. The files are then written whichever branch starts aks-node-controller.
  • If that line isn't present, fall back to the start of the launcher line, then the systemctl line.
  • Added a unit test asserting that the nohup ... launcher.sh line stays intact and that the rendered boothook passes bash -n.

Test-only change; no production code paths are affected.

suyadav1 and others added 2 commits November 6, 2026 10:24
…ting nohup launcher

injectWriteFilesEntriesToBoothookCustomData spliced the write_files block at
the index of "/bin/bash .../aks-node-controller-launcher.sh", which is mid-line
right after "nohup ". That left a bare "nohup" ("nohup: missing operand") and
failed the boothook, so Ubuntu2204_PreProvision_CustomCAFailure timed out
instead of exiting 161. Insert at the start of the logger line preceding the
launcher block (falling back to the start of the launcher/systemctl line).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@suyadav1
suyadav1 requested review from a team as code owners November 6, 2026 18:25
Copilot AI balanced review requested due to automatic review settings November 6, 2026 18:25
@suyadav1
suyadav1 enabled auto-merge (squash) November 6, 2026 18:25
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   21 suites   58s ⏱️
789 tests 789 ✅ 0 💤 0 ❌
815 runs  815 ✅ 0 💤 0 ❌

Results for commit 8a566f6.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
test 0% ❌
windows 27% ❌
staging_cse_windows Package 1 71% ➖
debug 0% ❌
provisioningscripts 2% ❌
parts_windows Package 1 73% ➖
Summary 39% (1983 / 7220) ❌

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the E2E cloud-boothook injection fix.

No open issues 🎉

What changed in this PR

Fixes cloud-boothook file injection in AgentBaker’s E2E harness so it does not split the nohup launcher command, addressing the reported CustomCAFailure gate failures. Production code paths are unchanged.

Changes:

  • Inserts file-writing commands at a line boundary, preferring the logger before the launcher branches and retaining launcher/systemctl fallbacks.
  • Adds regression checks for launcher integrity, insertion order, and Bash syntax with and without the logger line.
File Description
e2e/​scenario/​vmss.go Selects an insertion marker and moves the insertion point to its line start.
e2e/​scenario/​vmss_test.go Adds regression tests preserving the launcher command and checking rendered Bash syntax.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
shellspec spec 29% ❌
Summary 29% (4880 / 16595) ❌

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
github.com/Azure/agentbaker/aks-node-controller 73% ➖
github.com/Azure/agentbaker/aks-node-controller/common 100% ✔
github.com/Azure/agentbaker/aks-node-controller/helpers 68% ➖
github.com/Azure/agentbaker/aks-node-controller/parser 88% ✔
github.com/Azure/agentbaker/aks-node-controller/pkg/gpu 100% ✔
github.com/Azure/agentbaker/aks-node-controller/pkg/nodeconfigutils 92% ✔
github.com/Azure/agentbaker/aks-node-controller/utils 0% ❌
github.com/Azure/agentbaker/apiserver 24% ❌
github.com/Azure/agentbaker/cmd 0% ❌
github.com/Azure/agentbaker/cmd/starter 0% ❌
github.com/Azure/agentbaker/fuzz/api 0% ❌
github.com/Azure/agentbaker/hotfix/render-nodecustomdata 35% ❌
github.com/Azure/agentbaker/pkg/agent 79% ➖
github.com/Azure/agentbaker/pkg/agent/datamodel 77% ➖
github.com/Azure/agentbaker/pkg/agent/toggles 0% ❌
github.com/Azure/agentbaker/pkg/vhdbuilder/datamodel 87% ✔
Summary 76% (6093 / 8041) ➖

@suyadav1 suyadav1 closed this Nov 6, 2026
auto-merge was automatically disabled November 6, 2026 18:48

Pull request was closed

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.

2 participants