@@ -576,6 +576,8 @@ func TestBootstrapConcurrentCore(t *testing.T) {
576576 mockStoreClient.EXPECT().GetNodes(gomock.Any()).Return(nodes, nil).AnyTimes()
577577 mockStoreClient.EXPECT().IsBackendDeleting(gomock.Any(), gomock.Any()).Return(false).AnyTimes()
578578 mockStoreClient.EXPECT().GetVolumeMoves(gomock.Any()).Return(nil, nil).AnyTimes()
579+ // VP sync happens asynchronously, so we allow UpdateVolumePublication to be called
580+ mockStoreClient.EXPECT().UpdateVolumePublication(gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
579581 },
580582 verifyError: func(err error) {
581583 assert.NoError(t, err)
@@ -675,6 +677,8 @@ func TestBootstrapConcurrentCore(t *testing.T) {
675677 mockStoreClient.EXPECT().GetNodes(gomock.Any()).Return(nodes, nil).AnyTimes()
676678 mockStoreClient.EXPECT().IsBackendDeleting(gomock.Any(), gomock.Any()).Return(false).AnyTimes()
677679 mockStoreClient.EXPECT().GetVolumeMoves(gomock.Any()).Return(nil, nil).AnyTimes()
680+ // VP sync happens asynchronously, so we allow UpdateVolumePublication to be called
681+ mockStoreClient.EXPECT().UpdateVolumePublication(gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
678682 },
679683 verifyError: func(err error) {
680684 assert.NoError(t, err)
@@ -23209,7 +23213,7 @@ func TestConcurrentTridentOrchestrator_StageVolumeMove(t *testing.T) {
2320923213 assert.Nil(t, cached.Config.MoveInfo, "backend stage failure must not set MoveInfo")
2321023214 })
2321123215
23212- t.Run("happy path records MoveInfo", func(t *testing.T) {
23216+ t.Run("happy path sets MoveInfo on success ", func(t *testing.T) {
2321323217 o, vol, mockBackend, mockStoreClient, _ := setupConcurrentMoveInfoFixture(t)
2321423218
2321523219 mockBackend.EXPECT().StageVolumeMove(gomock.Any(), gomock.Any(), gomock.Any()).
@@ -23222,7 +23226,7 @@ func TestConcurrentTridentOrchestrator_StageVolumeMove(t *testing.T) {
2322223226
2322323227 cached := getVolumeByNameFromCache(t, vol.Config.Name)
2322423228 require.NotNil(t, cached)
23225- require.NotNil(t, cached.Config.MoveInfo)
23229+ require.NotNil(t, cached.Config.MoveInfo, "StageVolumeMove must set MoveInfo on success" )
2322623230 assert.Equal(t, models.VolumeMoveStateControllerStaging, cached.Config.MoveInfo.State)
2322723231 })
2322823232}
@@ -23265,7 +23269,7 @@ func TestConcurrentTridentOrchestrator_MoveVolume(t *testing.T) {
2326523269 assert.True(t, errors.IsVolumeStateError(err))
2326623270 })
2326723271
23268- t.Run("backend transient error still updates MoveInfo", func(t *testing.T) {
23272+ t.Run("backend transient error does not project MoveInfo", func(t *testing.T) {
2326923273 o, vol, mockBackend, mockStoreClient, _ := setupConcurrentMoveInfoFixture(t)
2327023274 vol.Pool = "pool-original"
2327123275 addVolumesToCache(t, vol)
@@ -23279,12 +23283,11 @@ func TestConcurrentTridentOrchestrator_MoveVolume(t *testing.T) {
2327923283
2328023284 cached := getVolumeByNameFromCache(t, vol.Config.Name)
2328123285 require.NotNil(t, cached)
23282- require.NotNil(t, cached.Config.MoveInfo, "transient error must still update MoveInfo")
23283- assert.Equal(t, models.VolumeMoveStateMoving, cached.Config.MoveInfo.State)
23286+ assert.Nil(t, cached.Config.MoveInfo, "MoveVolume must not project MoveInfo; commitState owns projection")
2328423287 assert.Equal(t, "pool-original", cached.Pool, "pool should not change on transient move errors")
2328523288 })
2328623289
23287- t.Run("happy path records MoveInfo", func(t *testing.T) {
23290+ t.Run("happy path persists target pool and sets MoveInfo", func(t *testing.T) {
2328823291 o, vol, mockBackend, mockStoreClient, _ := setupConcurrentMoveInfoFixture(t)
2328923292 vol.Pool = "pool-original"
2329023293 addVolumesToCache(t, vol)
@@ -23301,7 +23304,7 @@ func TestConcurrentTridentOrchestrator_MoveVolume(t *testing.T) {
2330123304 cached := getVolumeByNameFromCache(t, vol.Config.Name)
2330223305 require.NotNil(t, cached)
2330323306 require.NotNil(t, cached.Config.MoveInfo)
23304- assert.Equal (t, models.VolumeMoveStateMoving, cached.Config.MoveInfo.State )
23307+ assert.NotNil (t, cached.Config.MoveInfo, "MoveVolume must set MoveInfo on success" )
2330523308 assert.Equal(t, "pool-target", cached.Pool, "pool should be updated to move target on success")
2330623309 })
2330723310}
@@ -23351,7 +23354,7 @@ func TestConcurrentTridentOrchestrator_UnstageVolumeMove(t *testing.T) {
2335123354 "backend unstage failure must leave MoveInfo untouched")
2335223355 })
2335323356
23354- t.Run("happy path clears MoveInfo", func(t *testing.T) {
23357+ t.Run("happy path does not clear MoveInfo", func(t *testing.T) {
2335523358 o, vol, mockBackend, mockStoreClient, _ := setupConcurrentMoveInfoFixture(t)
2335623359
2335723360 vol.Config.MoveInfo = newConcMoveInfo(vol.Config.Name, models.VolumeMoveStateControllerUnstaging)
@@ -23367,8 +23370,7 @@ func TestConcurrentTridentOrchestrator_UnstageVolumeMove(t *testing.T) {
2336723370
2336823371 cached := getVolumeByNameFromCache(t, vol.Config.Name)
2336923372 require.NotNil(t, cached)
23370- assert.Nil(t, cached.Config.MoveInfo,
23371- "successful unstage must clear MoveInfo")
23373+ assert.NotNil(t, cached.Config.MoveInfo, "UnstageVolumeMove must not clear MoveInfo")
2337223374 })
2337323375}
2337423376
0 commit comments