@@ -113,14 +113,14 @@ func TestInferencePoolReconciler(t *testing.T) {
113113 ctx := context .Background ()
114114
115115 pmf := backendmetrics .NewPodMetricsFactory (& backendmetrics.FakePodMetricsClient {}, time .Second )
116- datastore := datastore .NewDatastore (ctx , pmf )
117- inferencePoolReconciler := & InferencePoolReconciler {Reader : fakeClient , Datastore : datastore , PoolGKNN : gknn }
116+ ds := datastore .NewDatastore (ctx , pmf , 0 )
117+ inferencePoolReconciler := & InferencePoolReconciler {Reader : fakeClient , Datastore : ds , PoolGKNN : gknn }
118118
119119 // Step 1: Inception, only ready pods matching pool1 are added to the store.
120120 if _ , err := inferencePoolReconciler .Reconcile (ctx , req ); err != nil {
121121 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
122122 }
123- if diff := diffStore (datastore , diffStoreParams {wantPool : pool1 , wantPods : []string {"pod1" , "pod2" }}); diff != "" {
123+ if diff := diffStore (ds , diffStoreParams {wantPool : pool1 , wantPods : []string {"pod1-rank-0 " , "pod2-rank-0 " }}); diff != "" {
124124 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
125125 }
126126
@@ -138,7 +138,7 @@ func TestInferencePoolReconciler(t *testing.T) {
138138 if _ , err := inferencePoolReconciler .Reconcile (ctx , req ); err != nil {
139139 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
140140 }
141- if diff := diffStore (datastore , diffStoreParams {wantPool : newPool1 , wantPods : []string {"pod5" }}); diff != "" {
141+ if diff := diffStore (ds , diffStoreParams {wantPool : newPool1 , wantPods : []string {"pod5-rank-0 " }}); diff != "" {
142142 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
143143 }
144144
@@ -153,7 +153,7 @@ func TestInferencePoolReconciler(t *testing.T) {
153153 if _ , err := inferencePoolReconciler .Reconcile (ctx , req ); err != nil {
154154 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
155155 }
156- if diff := diffStore (datastore , diffStoreParams {wantPool : newPool1 , wantPods : []string {"pod5" }}); diff != "" {
156+ if diff := diffStore (ds , diffStoreParams {wantPool : newPool1 , wantPods : []string {"pod5-rank-0 " }}); diff != "" {
157157 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
158158 }
159159
@@ -167,7 +167,7 @@ func TestInferencePoolReconciler(t *testing.T) {
167167 if _ , err := inferencePoolReconciler .Reconcile (ctx , req ); err != nil {
168168 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
169169 }
170- if diff := diffStore (datastore , diffStoreParams {wantPods : []string {}}); diff != "" {
170+ if diff := diffStore (ds , diffStoreParams {wantPods : []string {}}); diff != "" {
171171 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
172172 }
173173}
@@ -258,14 +258,14 @@ func TestXInferencePoolReconciler(t *testing.T) {
258258 ctx := context .Background ()
259259
260260 pmf := backendmetrics .NewPodMetricsFactory (& backendmetrics.FakePodMetricsClient {}, time .Second )
261- datastore := datastore .NewDatastore (ctx , pmf )
262- inferencePoolReconciler := & InferencePoolReconciler {Reader : fakeClient , Datastore : datastore , PoolGKNN : gknn }
261+ ds := datastore .NewDatastore (ctx , pmf , 0 )
262+ inferencePoolReconciler := & InferencePoolReconciler {Reader : fakeClient , Datastore : ds , PoolGKNN : gknn }
263263
264264 // Step 1: Inception, only ready pods matching pool1 are added to the store.
265265 if _ , err := inferencePoolReconciler .Reconcile (ctx , req ); err != nil {
266266 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
267267 }
268- if diff := xDiffStore (t , datastore , xDiffStoreParams {wantPool : pool1 , wantPods : []string {"pod1" , "pod2" }}); diff != "" {
268+ if diff := xDiffStore (t , ds , xDiffStoreParams {wantPool : pool1 , wantPods : []string {"pod1-rank-0 " , "pod2-rank-0 " }}); diff != "" {
269269 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
270270 }
271271
@@ -281,7 +281,7 @@ func TestXInferencePoolReconciler(t *testing.T) {
281281 if _ , err := inferencePoolReconciler .Reconcile (ctx , req ); err != nil {
282282 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
283283 }
284- if diff := xDiffStore (t , datastore , xDiffStoreParams {wantPool : newPool1 , wantPods : []string {"pod5" }}); diff != "" {
284+ if diff := xDiffStore (t , ds , xDiffStoreParams {wantPool : newPool1 , wantPods : []string {"pod5-rank-0 " }}); diff != "" {
285285 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
286286 }
287287
@@ -296,7 +296,7 @@ func TestXInferencePoolReconciler(t *testing.T) {
296296 if _ , err := inferencePoolReconciler .Reconcile (ctx , req ); err != nil {
297297 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
298298 }
299- if diff := xDiffStore (t , datastore , xDiffStoreParams {wantPool : newPool1 , wantPods : []string {"pod5" }}); diff != "" {
299+ if diff := xDiffStore (t , ds , xDiffStoreParams {wantPool : newPool1 , wantPods : []string {"pod5-rank-0 " }}); diff != "" {
300300 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
301301 }
302302
@@ -310,7 +310,7 @@ func TestXInferencePoolReconciler(t *testing.T) {
310310 if _ , err := inferencePoolReconciler .Reconcile (ctx , req ); err != nil {
311311 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
312312 }
313- if diff := xDiffStore (t , datastore , xDiffStoreParams {wantPods : []string {}}); diff != "" {
313+ if diff := xDiffStore (t , ds , xDiffStoreParams {wantPods : []string {}}); diff != "" {
314314 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
315315 }
316316}
0 commit comments