Skip to content

Conversation

@Rattysed
Copy link
Collaborator

@Rattysed Rattysed commented Nov 26, 2025

#4729

Preparing the cells storage for metrics. Removing redundant structure clusterCapacityState, making CreatedAt field public in cells.ClusterCapacity

@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 Nov 26, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2025

Note

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

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit ce6c4c3.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
1235 1226 0 6 0 3 0

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit ce6c4c3.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
76 67 0 6 0 3 0

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit ce6c4c3.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
76 67 0 6 0 3 0

@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2025

Note

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

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 613fcce.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
1235 1228 0 4 0 3 0

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 613fcce.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
72 65 0 4 0 3 0

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 613fcce.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
72 65 0 4 0 3 0

@Rattysed Rattysed removed the large-tests Launch large tests for PR label Nov 26, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2025

Note

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

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 45c3f99.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
945 938 0 4 0 3 0

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 45c3f99.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
72 65 0 4 0 3 0

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 45c3f99.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
72 65 0 4 0 3 0

@github-actions
Copy link
Contributor

github-actions bot commented Nov 27, 2025

Note

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

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 7d3a70f.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
945 938 0 4 0 3 0

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 7d3a70f.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
162 155 0 4 0 3 0

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 7d3a70f.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
72 65 0 4 0 3 0

@github-actions
Copy link
Contributor

github-actions bot commented Nov 27, 2025

Note

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

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 32e1cce.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
945 944 0 1 0 0 0

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 32e1cce.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
45 44 0 1 0 0 0

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 32e1cce.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
45 44 0 1 0 0 0

@github-actions
Copy link
Contributor

Note

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

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

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
945 945 0 0 0 0 0

@Rattysed Rattysed added the large-tests Launch large tests for PR label Nov 27, 2025

// Uses WithinDuration to compare CreatedAt field correctly, since == may fail
// due to different internal representations.
func requireClusterCapacitiesAreEqual(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

В комменте отписал, конечно, но на всякий: таймстемпы сравнивать через require.Equal нельзя, т.к. после записи в БД они чуть-чуть меняются

capacity1,
cellCapacity1,
}, capacities)
sort.Slice(capacities, func(i, j int) bool {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Порядок получения из GetRecentClusterCapacitites не детерминирован. Имхо, ради тестов его фиксировать бессмысленно. Так что проще отсортировать на месте


////////////////////////////////////////////////////////////////////////////////

func matchClusterCapacities(t *testing.T, expected cells_storage.ClusterCapacity) interface{} {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Теперь CreatedAt задаём в коде таски, нужно сверять время. Обычно в таких случаях мы просто подставляем mock.Anything, но тут терялся бы смысл теста.

В матчере сравниваем полученное время с time.Now(), т.к. такой же time.Now() выставляется в коде таски. Минута про запас

@Rattysed Rattysed marked this pull request as ready for review November 27, 2025 09:15
@github-actions
Copy link
Contributor

Note

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

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

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
1235 1235 0 0 0 0 0

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

expected.TotalBytes != got.TotalBytes ||
expected.CellID != got.CellID || expected.Kind != got.Kind ||
expected.ZoneID != got.ZoneID ||
time.Now().Sub(got.CreatedAt).Abs() >= time.Minute {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Давай сначала сделаем проверку на время, потом приравняем время и сравним expected и got целиком на равенство? А то если в структуру потом добавится новое поле, то тут легко забыть добавить проверку.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Логично. Исправил в обоих тестах

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

Note

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

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

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
1235 1235 0 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.

3 participants