-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Disk Manager] Fix disk manager tests after updating StatVolume behaviour #2924
base: main
Are you sure you want to change the base?
Changes from all commits
74ce7f2
7730c9f
345b77b
15301c7
0d5ca4d
d3447ad
4b577ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ import ( | |
"github.com/ydb-platform/nbs/cloud/disk_manager/internal/pkg/clients/nbs" | ||
"github.com/ydb-platform/nbs/cloud/disk_manager/internal/pkg/common" | ||
"github.com/ydb-platform/nbs/cloud/disk_manager/internal/pkg/facade/testcommon" | ||
"github.com/ydb-platform/nbs/cloud/disk_manager/internal/pkg/types" | ||
) | ||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
|
@@ -77,7 +78,7 @@ func testCreateSnapshotFromDisk( | |
require.NoError(t, err) | ||
require.Equal(t, float64(1), meta.Progress) | ||
|
||
testcommon.RequireCheckpointsAreEmpty(t, ctx, diskID) | ||
testcommon.RequireCheckpoint(t, ctx, diskID, snapshotID) | ||
|
||
reqCtx = testcommon.GetRequestContext(t, ctx) | ||
operation, err = client.DeleteSnapshot(reqCtx, &disk_manager.DeleteSnapshotRequest{ | ||
|
@@ -604,17 +605,22 @@ func TestSnapshotServiceDeleteIncrementalSnapshotWhileCreating(t *testing.T) { | |
err = internal_client.WaitOperation(ctx, client, deleteOperation.Id) | ||
require.NoError(t, err) | ||
|
||
//nolint:sa9003 | ||
// TODO: remove line above after | ||
// https://github.com/ydb-platform/nbs/issues/2008 | ||
if creationErr == nil { | ||
testcommon.RequireCheckpointsAreEmpty(t, ctx, diskID) | ||
testcommon.RequireCheckpointsDoNotExist(t, ctx, diskID) | ||
} else { | ||
// Checkpoint that corresponds to base snapshot should not be deleted. | ||
// NOTE: we use snapshot id as checkpoint id. | ||
// TODO: enable this check after resolving issue | ||
// https://github.com/ydb-platform/nbs/issues/2008. | ||
// testcommon.RequireCheckpoint(t, ctx, diskID, baseSnapshotID) | ||
snapshotID, _, err := testcommon.GetIncremental(ctx, &types.Disk{ | ||
ZoneId: "zone-a", | ||
DiskId: diskID, | ||
}) | ||
BarkovBG marked this conversation as resolved.
Show resolved
Hide resolved
|
||
require.NoError(t, err) | ||
Rattysed marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// If there is a record about this disk left in incrementality table, | ||
// checkpoint that corresponds to base snapshot should not be deleted. | ||
Comment on lines
+617
to
+618
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. тут нужо рассказать, что в случае неуспешного создания может быть два сценария если мы успели потереть данные про baseSnapshotID из таблицы инкрементальности или нет типо: что-то такое из твоего комментария вообще не понятно что происходит и почему так |
||
if len(snapshotID) > 0 { | ||
testcommon.RequireCheckpoint(t, ctx, diskID, baseSnapshotID) | ||
} else { | ||
testcommon.RequireCheckpointsDoNotExist(t, ctx, diskID) | ||
} | ||
} | ||
|
||
snapshotID2 := t.Name() + "2" | ||
|
@@ -702,7 +708,7 @@ func TestSnapshotServiceDeleteSnapshot(t *testing.T) { | |
err = internal_client.WaitOperation(ctx, client, operation2.Id) | ||
require.NoError(t, err) | ||
|
||
testcommon.RequireCheckpointsAreEmpty(t, ctx, diskID) | ||
testcommon.RequireCheckpointsDoNotExist(t, ctx, diskID) | ||
testcommon.CheckConsistency(t, ctx) | ||
} | ||
|
||
|
@@ -758,13 +764,13 @@ func TestSnapshotServiceDeleteSnapshotWhenCreationIsInFlight(t *testing.T) { | |
err = internal_client.WaitOperation(ctx, client, operation.Id) | ||
require.NoError(t, err) | ||
|
||
_ = internal_client.WaitOperation(ctx, client, createOp.Id) | ||
createErr := internal_client.WaitOperation(ctx, client, createOp.Id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. просто err |
||
|
||
// Should wait here because checkpoint is deleted on |createOp| operation | ||
// cancel (and exact time of this event is unknown). | ||
// TODO: enable this check after resolving issue | ||
// https://github.com/ydb-platform/nbs/issues/2008. | ||
// testcommon.WaitForCheckpointsAreEmpty(t, ctx, diskID) | ||
if createErr != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. выше ифа надо написать почему мы ждем чекпоинты только если создание успешное |
||
// Should wait here because checkpoint is deleted on |createOp| operation | ||
// cancel (and exact time of this event is unknown). | ||
testcommon.WaitForCheckpointsAreEmpty(t, ctx, diskID) | ||
} | ||
|
||
testcommon.CheckConsistency(t, ctx) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут сверху ифа нужно рассказать, почему у нас две ветки в зависимости от ошибки создания
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 - снапшот успел создастся, а затем удалиться - тогда чепоинта не должно быть