@@ -28,24 +28,29 @@ import (
28
28
func CreateTestAllocator (
29
29
ctx context.Context , numNodes int , deterministic bool ,
30
30
) (* stop.Stopper , * gossip.Gossip , * storepool.StorePool , Allocator , * timeutil.ManualTime ) {
31
- return CreateTestAllocatorWithKnobs (ctx , numNodes , deterministic , nil /* knobs */ )
31
+ return CreateTestAllocatorWithKnobs (ctx , numNodes , deterministic ,
32
+ nil /* allocator.TestingKnobs */ , nil /* mmaintegration.TestingKnobs */ )
32
33
}
33
34
34
35
// CreateTestAllocatorWithKnobs is like `CreateTestAllocator`, but allows the
35
36
// caller to pass in custom TestingKnobs. Stopper must be stopped by
36
37
// the caller.
37
38
func CreateTestAllocatorWithKnobs (
38
- ctx context.Context , numNodes int , deterministic bool , knobs * allocator.TestingKnobs ,
39
+ ctx context.Context ,
40
+ numNodes int ,
41
+ deterministic bool ,
42
+ allocatorKnobs * allocator.TestingKnobs ,
43
+ allocSyncKnobs * mmaintegration.TestingKnobs ,
39
44
) (* stop.Stopper , * gossip.Gossip , * storepool.StorePool , Allocator , * timeutil.ManualTime ) {
40
45
st := cluster .MakeTestingClusterSettings ()
41
46
stopper , g , manual , storePool , _ := storepool .CreateTestStorePool (ctx , st ,
42
47
liveness .TestTimeUntilNodeDeadOff , deterministic ,
43
48
func () int { return numNodes },
44
49
livenesspb .NodeLivenessStatus_LIVE )
45
50
mmAllocator := mmaprototype .NewAllocatorState (timeutil.DefaultTimeSource {}, rand .New (rand .NewSource (timeutil .Now ().UnixNano ())))
46
- as := mmaintegration .NewAllocatorSync (storePool , mmAllocator , st )
51
+ as := mmaintegration .NewAllocatorSync (storePool , mmAllocator , st , allocSyncKnobs )
47
52
a := MakeAllocator (st , as , deterministic , func (id roachpb.NodeID ) (time.Duration , bool ) {
48
53
return 0 , true
49
- }, knobs )
54
+ }, allocatorKnobs )
50
55
return stopper , g , storePool , a , manual
51
56
}
0 commit comments