test(firmware): reconcile the WiFi update SCPI sequence expectations (part of #269) - #456
Conversation
…(part of #269) PRs #444 and #445 both branched from 4b8eed2 and were green there, but each changed the SCPI traffic the other's tests assert on. Git merged them without a textual conflict, so main landed with five failing tests. #444 made prep power the WINC on before LAN:FWUpdate (LAN commands are rejected while the module is unpowered), which prepends SYSTem:POWer:STATe 1 to every sequence #445's four recovery tests pin. #445 made a failed or canceled flash walk the device back out of bridge mode, which appends a transparent-mode exit and a LAN:APPLY kick to the cancel path #444's settle-placement test pins. Both behaviors are the intended ones and neither is changed here — only the expectations, which were each written against a base that predated the other. The settle-placement test still proves what it claims: the LAN:ENAbled/SAVE restore is what the settle holds back, and neither command is sent. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
PR Summary by QodoFix WiFi update SCPI sequence assertions in firmware tests
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
|
/agentic_review |
Code Review by Qodo
1.
|
…ment Qodo review: the comment called the restore "LAN:ENAbled + LAN:SAVE", but the restore is LAN:ENAbled -> APPLY -> SAVE. Cancellation holds back all three; the APPLY the test still expects is the failure recovery's bridge-exit kick, which is a different command with a different job. Say so, and say what distinguishes the two: the recovery re-sends the transparent-mode exit ahead of itself and is never accompanied by ENAbled or SAVE. Comment-only; the pinned sequences and production code are unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 3ffc516 |
Problem
Five
FirmwareUpdateServiceTestsfail on a clean checkout ofmain(7965b26), on bothnet9.0andnet10.0:UpdateWifiModuleAsync_WhenRecoveryBudgetExpiresAfterReconnect_StillFinishesTheBridgeExitUpdateWifiModuleAsync_WhenCanceledAfterEnteringUpdateMode_StillTakesDeviceBackOutUpdateWifiModuleAsync_WhenFlashToolFails_TakesDeviceBackOutOfLanUpdateModeUpdateWifiModuleAsync_WhenCanceledDuringTransparentModeExitSettle_LeavesLanRestoreUnsentUpdateWifiModuleAsync_WhenRecoveryBudgetExpiresWaitingForReconnect_SendsNoBridgeExitBisect
1967c2ee)06bcf8ae)da35eff— #445 merged7965b26— #444 mergedBoth PRs branched from the same base (
4b8eed2) and were green there. They touched different regions ofWifiModuleUpdater.cs, so git merged them with no textual conflict — but each changed the SCPI traffic the other's tests assert on.7965b26is the commit that broke it only because it merged second.Which side is wrong
The test expectations, on both sides. Neither production behavior is changed here.
#444 → breaks #445's four recovery tests. Prep now powers the WINC on before
LAN:FWUpdate, because LAN commands are rejected (-200) while the module is unpowered, so the mode command would silently not take. That prependsSYSTem:POWer:STATe 1to every sequence those four tests pin. The behavior is deliberate, hardware-backed, and separately covered by #444's own toggle tests (PowerOnWifiModuleBeforeLanUpdateModeon/off) and by the success-path sequence assertion, all of which still pass.#445 → breaks #444's settle-placement test. A failed or canceled flash now walks the device back out of bridge mode, so the cancel path gains a second transparent-mode exit and a
LAN:APPLYkick. That is the entire point of #445 — a canceled flash mid-bridge is the most likely way to strand the module — and the recovery deliberately omitsLAN:ENAbled/LAN:SAVEso it cannot persist a configuration off a flash that did not complete. The redundantSetTransparentMode 0is a documented no-op; theLAN:APPLYis genuinely needed, because at the cancel point the console has been handed back but the WiFi manager has not been kicked out of its bridge-mode state machine — the one state worse than either end of the sequence.UpdateWifiModuleAsync_WhenCanceledDuringTransparentModeExitSettle_LeavesLanRestoreUnsentstill proves what its name and comment claim: the restore isLAN:ENAbled+LAN:SAVE, and neither is sent. Only the trailing recovery pair is new, and the comment now says so.Verification
Full solution, both TFMs:
Daqifi.Core.Tests— 2703 passed, 0 failed, 2 skipped (net9.0 and net10.0)Daqifi.Mcp.Tests— 23 passed, 0 failedTests only; no production code touched.
🤖 Generated with Claude Code