From 6cb02564f46d8d767e91643a86471dc83cf0ee5f Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Feb 2026 11:23:19 +0000 Subject: [PATCH] fix(test): correct concurrent dispatch test allowance override registerAgent hardcodes ConcurrentJobs: 5, but the concurrent test launches 10 goroutines. Override with ConcurrentJobs: 0 (unlimited) so all 10 dispatches succeed as intended. Co-Authored-By: Charon --- dispatcher_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dispatcher_test.go b/dispatcher_test.go index f762b13..8921ae7 100644 --- a/dispatcher_test.go +++ b/dispatcher_test.go @@ -248,7 +248,13 @@ func TestDispatcher_DispatchLoop_Good_NilClientSkipsTick(t *testing.T) { func TestDispatcher_Dispatch_Good_Concurrent(t *testing.T) { d, reg, store := setupDispatcher(t, nil) - registerAgent(t, reg, store, "agent-1", nil, 0) // unlimited + registerAgent(t, reg, store, "agent-1", nil, 0) + // Override allowance to truly unlimited (registerAgent hardcodes ConcurrentJobs: 5) + _ = store.SetAllowance(&AgentAllowance{ + AgentID: "agent-1", + DailyJobLimit: 100, + ConcurrentJobs: 0, // 0 = unlimited + }) var wg sync.WaitGroup for i := 0; i < 10; i++ {