CloudMigrations: Fix bugs found during local testing (#91163)
* send dashboard commands instead of dashboards * move status updates before goroutine to ensure frontend polls * fix syncing issues between snapshot state and resources * make sessionUid a requirement for modifying snapshots * move the function I meant to move earlier * remove accidental commit * another accidental commit * verify UpdateSnapshot is called with sessionUid * revert * pass in session uid everywhere * forgot to save * fix unit test * fix typo * tiny tweak
This commit is contained in:
@@ -182,16 +182,16 @@ func Test_SnapshotManagement(t *testing.T) {
|
||||
require.NotEmpty(t, snapshotUid)
|
||||
|
||||
//retrieve it from the db
|
||||
snapshot, err := s.GetSnapshotByUID(ctx, snapshotUid, 0, 0)
|
||||
snapshot, err := s.GetSnapshotByUID(ctx, sessionUid, snapshotUid, 0, 0)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, cloudmigration.SnapshotStatusCreating, snapshot.Status)
|
||||
|
||||
// update its status
|
||||
err = s.UpdateSnapshot(ctx, cloudmigration.UpdateSnapshotCmd{UID: snapshotUid, Status: cloudmigration.SnapshotStatusCreating})
|
||||
err = s.UpdateSnapshot(ctx, cloudmigration.UpdateSnapshotCmd{UID: snapshotUid, Status: cloudmigration.SnapshotStatusCreating, SessionID: sessionUid})
|
||||
require.NoError(t, err)
|
||||
|
||||
//retrieve it again
|
||||
snapshot, err = s.GetSnapshotByUID(ctx, snapshotUid, 0, 0)
|
||||
snapshot, err = s.GetSnapshotByUID(ctx, sessionUid, snapshotUid, 0, 0)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, cloudmigration.SnapshotStatusCreating, snapshot.Status)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user