Skip to content

Commit

Permalink
fix review issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gy2411 committed Feb 4, 2025
1 parent 7470e96 commit 7c8a71b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cloud/disk_manager/internal/pkg/clients/nbs/testing_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,15 +596,15 @@ func (c *testingClient) DisableDevices(
return fmt.Errorf("list of devices to disable should contain at least one device")
}

deviceUUIDsField, err := json.Marshal(deviceUUIDs)
j, err := json.Marshal(deviceUUIDs)
if err != nil {
return nil
}

input := fmt.Sprintf(
"{\"DisableAgent\":{\"AgentId\":\"%v\",\"DeviceUUIDs\":%v},\"Message\":\"%v\"}",
agentID,
string(deviceUUIDsField),
string(j),
message,
)

Expand Down
16 changes: 8 additions & 8 deletions cloud/disk_manager/internal/pkg/clients/nbs/tests/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1779,16 +1779,16 @@ func TestEnsureCheckpointReady(t *testing.T) {

// Disabling device to enforce checkpoint status ERROR.
go func() {
// Waiting for the shadow disk to be created. At the same time, we do
// not wait for too long: device should be disabled before the
// checkpoint becomes ready.
time.Sleep(time.Second * 1)
var diskRegistryStateBackup nbs.DiskRegistryStateBackup
var shadowDisk *nbs.DiskRegistryBasedDisk

diskRegistryStateBackup, err := client.BackupDiskRegistryState(ctx)
require.NoError(t, err)
// Waiting for the shadow disk to be created.
for shadowDisk == nil {
diskRegistryStateBackup, err := client.BackupDiskRegistryState(ctx)
require.NoError(t, err)
shadowDisk = diskRegistryStateBackup.GetShadowDisk(diskID)
}

shadowDisk := diskRegistryStateBackup.GetShadowDisk(diskID)
require.NotNil(t, shadowDisk)
deviceUUIDs := shadowDisk.DeviceUUIDs
require.Equal(t, 1, len(deviceUUIDs))

Expand Down

0 comments on commit 7c8a71b

Please sign in to comment.