Skip to content
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 flappy test for snapshot service #3120

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Rattysed
Copy link
Collaborator

@Rattysed Rattysed commented Feb 28, 2025

One of the tests affected by #2008 was not correct.
One of it's flaps: https://github.com/ydb-platform/nbs/actions/runs/13579009298

Also changed WaitForCheckpointsDoNotExist method for better testing

@Rattysed Rattysed changed the title [Disk Manager] Fix [Disk Manager] Fix flappy test for snapshot service Feb 28, 2025
@Rattysed Rattysed added large-tests Launch large tests for PR disk_manager Add this label to run only cloud/disk_manager build and tests on PR labels Feb 28, 2025
@Rattysed Rattysed marked this pull request as draft February 28, 2025 15:07
Copy link
Contributor

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo: all tests PASSED for commit e9a2aea.

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
870 870 0 0 0 0

@Rattysed Rattysed marked this pull request as ready for review March 3, 2025 16:32
Copy link
Contributor

github-actions bot commented Mar 3, 2025

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo: all tests PASSED for commit 688c6cc.

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
870 870 0 0 0 0

Copy link
Contributor

github-actions bot commented Mar 4, 2025

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo: all tests PASSED for commit f6eed5f.

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
870 870 0 0 0 0

Copy link
Contributor

github-actions bot commented Mar 4, 2025

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo: all tests PASSED for commit 7df6970.

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
870 870 0 0 0 0

@@ -377,7 +378,20 @@ func WaitForCheckpointsDoNotExist(
checkpoints, err := nbsClient.GetCheckpoints(ctx, diskID)
require.NoError(t, err)

if len(checkpoints) == 0 {
checkpointSet := make(map[string]struct{}, len(checkpoints))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Думаю, получается слишком сложный код на ровном месте.

Может оставить WaitForCheckpointsDoNotExist как был, и написать отдельный метод на ожидание конкретных чекпоинтов? Мб даже не передавать туда слайс чекпоинтов, а только один чекпоинт.

Copy link
Collaborator Author

@Rattysed Rattysed Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тоже думал так сделать. А если нам понадобится ждать 2 чекпоинта, то сделать ещё один метод, ожидающий 2 чекпоинта?
Конечно, такое маловероятно, но всё же получаем копипасту

Copy link
Contributor

github-actions bot commented Mar 6, 2025

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo: all tests PASSED for commit c4641ae.

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
870 870 0 0 0 0

Comment on lines 615 to 619
// If snapshot creation ends up successfuly, there may be two cases:
// Snapshot was created and then deleted, so should be no checkpoints left
// or snapshot deletion ended up before creation, snapshot was not deleted,
// so there should be a checkpoint.
if creationErr != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

чет я не понял комментария

ты пишешь про случае когда снапшот успешно создался

а иф проверяет то что создание с ошибой упало

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пишу как раз чтобы объяснить, почему этот случай не проверяем. Для случая с ошибкой комментарий внутри

snapshotID, _, err := testcommon.GetIncremental(ctx, &types.Disk{
ZoneId: "zone-a",
DiskId: diskID,
})
require.NoError(t, err)

// Should wait here because checkpoint is deleted on |createOperation|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не понятный коммент

что за |createOperation| operation?

во-первых - какая-то тавтология
во-вторых - что это за операция такая? может ты имел в виду createSnapshot?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сверху есть переменная createOperation, на ошибку от которой мы и смотрим. Про тавтологию согласен

Copy link
Contributor

github-actions bot commented Mar 7, 2025

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo: all tests PASSED for commit 7959f6f.

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
870 870 0 0 0 0

Copy link
Contributor

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo: all tests PASSED for commit 12f3e4b.

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
870 870 0 0 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disk_manager Add this label to run only cloud/disk_manager build and tests on PR large-tests Launch large tests for PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants