From 42a4db5f42a078a9f15136f40f0abe0c4d2bf4f4 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Thu, 20 Aug 2026 05:00:23 +0800 Subject: [PATCH] fix(qa): wait for config restart wake (#126368) --- .../src/scenario-catalog.config-restart.test.ts | 17 +++++++++++++++++ .../config/config-restart-capability-flip.yaml | 10 ++++++++++ 2 files changed, 27 insertions(+) create mode 100644 extensions/qa-lab/src/scenario-catalog.config-restart.test.ts diff --git a/extensions/qa-lab/src/scenario-catalog.config-restart.test.ts b/extensions/qa-lab/src/scenario-catalog.config-restart.test.ts new file mode 100644 index 000000000000..187d1db67c63 --- /dev/null +++ b/extensions/qa-lab/src/scenario-catalog.config-restart.test.ts @@ -0,0 +1,17 @@ +// Qa Lab tests cover config-restart scenario ordering. +import { describe, expect, it } from "vitest"; +import { readQaScenarioById } from "./scenario-catalog.js"; + +describe("QA config-restart scenario catalog", () => { + it("waits for the restart wake before using restored capabilities", () => { + const flow = JSON.stringify(readQaScenarioById("config-restart-capability-flip")); + const restartPatchIndex = flow.indexOf('"note":{"ref":"wakeMarker"}'); + const wakeWaitIndex = flow.indexOf("candidate.text.includes(wakeMarker)"); + const capabilityPollIndex = flow.indexOf('"saveAs":"afterTools"'); + + expect(restartPatchIndex).toBeGreaterThanOrEqual(0); + expect(wakeWaitIndex).toBeGreaterThan(restartPatchIndex); + expect(capabilityPollIndex).toBeGreaterThan(wakeWaitIndex); + expect(flow.indexOf('"call":"runAgentPrompt"')).toBeGreaterThan(capabilityPollIndex); + }); +}); diff --git a/qa/scenarios/config/config-restart-capability-flip.yaml b/qa/scenarios/config/config-restart-capability-flip.yaml index 95da6f4b8a12..7ccf3a49d975 100644 --- a/qa/scenarios/config/config-restart-capability-flip.yaml +++ b/qa/scenarios/config/config-restart-capability-flip.yaml @@ -111,6 +111,9 @@ flow: ref: originalImageGenerationModelPrimary sessionKey: ref: sessionKey + deliveryContext: + channel: qa-channel + to: dm:qa-operator note: ref: wakeMarker replacePaths: @@ -123,6 +126,13 @@ flow: args: - ref: env - 60000 + - call: waitForOutboundMessage + args: + - ref: state + - lambda: + params: [candidate] + expr: "candidate.conversation.id === 'qa-operator' && candidate.text.includes(wakeMarker)" + - expr: liveTurnTimeoutMs(env, config.imageTurnTimeoutMs) - call: waitForCondition saveAs: afterTools args: