(t *testing.T)
| 67 | } |
| 68 | } |
| 69 | |
| 70 | func TestNewMemoryRebalancerDefaults(t *testing.T) { |
| 71 | // With 0 budget, should auto-detect (or fallback) |
| 72 | r := NewMemoryRebalancer(0, 0, &mockSessionLister{}, true) |
| 73 | t.Cleanup(r.Stop) |
| 74 | if r.memoryBudget == 0 { |
| 75 | t.Error("expected non-zero memory budget") |
| 76 | } |
| 77 | if r.threadBudget == 0 { |
| 78 | t.Error("expected non-zero thread budget") |
| 79 | } |
| 80 | wantThreads := (runtime.NumCPU()*5 + 1) / 2 |
| 81 | if r.threadBudget != wantThreads { |
| 82 | t.Errorf("thread budget = %d, want ceil(2.5 * %d CPUs) = %d", r.threadBudget, runtime.NumCPU(), wantThreads) |
nothing calls this directly
no test coverage detected