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 <developers@lethean.io>
This commit is contained in:
Claude 2026-02-20 11:23:19 +00:00
parent 0be744e46a
commit 6cb02564f4
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -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++ {