mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-03 20:21:51 +08:00
fix: 按评审补齐 mock 校验、Worker 上限保护与测试(Codex gpt-6-sol)
This commit is contained in:
1 parent
a1dc362bae
commit
2e6ceddf95
8 files changed
+125
-21
No files matched your search
@@ -1,6 +1,10 @@
|
||||
package server
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/Autumn-27/artex/db"
|
||||
)
|
||||
|
||||
func TestWorkerCountForTaskUsesOverrideOrGlobalDefault(t *testing.T) {
|
||||
if got := workerCountForTask(&Task{WorkerCount: 5}, 3); got != 5 {
|
||||
@@ -12,4 +16,7 @@ func TestWorkerCountForTaskUsesOverrideOrGlobalDefault(t *testing.T) {
|
||||
if got := workerCountForTask(&Task{WorkerCount: -1}, 3); got != 3 {
|
||||
t.Fatalf("negative override = %d, want global 3", got)
|
||||
}
|
||||
if got := workerCountForTask(&Task{WorkerCount: db.MaxTaskWorkerCount + 1}, 3); got != db.MaxTaskWorkerCount {
|
||||
t.Fatalf("oversized override = %d, want capped %d", got, db.MaxTaskWorkerCount)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user