mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-04 13:51:30 +00:00
Tests: stabilize shard-2 queue and channel state
This commit is contained in:
committed by
Vignesh
parent
9c185faba9
commit
4d54376483
@@ -254,6 +254,18 @@ export function clearCommandLane(lane: string = CommandLane.Main) {
|
||||
return removed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test-only hard reset that discards all queue state, including preserved
|
||||
* queued work from previous generations. Use this when a suite needs an
|
||||
* isolated baseline across shared-worker runs.
|
||||
*/
|
||||
export function resetCommandQueueStateForTest(): void {
|
||||
const queueState = getQueueState();
|
||||
queueState.gatewayDraining = false;
|
||||
queueState.lanes.clear();
|
||||
queueState.nextTaskId = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset all lane runtime state to idle. Used after SIGUSR1 in-process
|
||||
* restarts where interrupted tasks' finally blocks may not run, leaving
|
||||
|
||||
Reference in New Issue
Block a user