mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-07-09 17:19:02 +00:00
fix(test): count result messages instead of assistant messages in multi-model E2E test (#4341)
Resolve turn-completion on isSDKResultMessage (one per turn) instead of isSDKAssistantMessage (which fires multiple times per turn: thinking + text), fixing the consistently-failing multi-model E2E test.
This commit is contained in:
parent
1b66f79555
commit
ee6746ec65
1 changed files with 6 additions and 6 deletions
|
|
@ -250,7 +250,7 @@ describe('System Control (E2E)', () => {
|
|||
|
||||
try {
|
||||
const systemMessages: Array<{ model?: string }> = [];
|
||||
let responseCount = 0;
|
||||
let turnCount = 0;
|
||||
const resolvers: Array<() => void> = [];
|
||||
const responsePromises = [
|
||||
new Promise<void>((resolve) => resolvers.push(resolve)),
|
||||
|
|
@ -265,11 +265,11 @@ describe('System Control (E2E)', () => {
|
|||
}
|
||||
if (isSDKResultMessage(message)) {
|
||||
resultWaiter.notifyResult();
|
||||
}
|
||||
if (isSDKAssistantMessage(message)) {
|
||||
if (responseCount < resolvers.length) {
|
||||
resolvers[responseCount]?.();
|
||||
responseCount++;
|
||||
// Resolve on result (one per turn), not assistant message
|
||||
// (which may fire multiple times per turn: thinking + text)
|
||||
if (turnCount < resolvers.length) {
|
||||
resolvers[turnCount]?.();
|
||||
turnCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue