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:
parent
0be744e46a
commit
6cb02564f4
1 changed files with 7 additions and 1 deletions
|
|
@ -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++ {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue