Skip to content

Fixes for compatibility tests #17931

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

Merged
merged 3 commits into from
May 5, 2025

Conversation

maximyurchuk
Copy link
Collaborator

@maximyurchuk maximyurchuk commented Apr 30, 2025

Fixes from comments in #17565

@maximyurchuk maximyurchuk requested a review from Copilot April 30, 2025 15:16
Copy link
Contributor

@Copilot 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.

Pull Request Overview

This PR implements fixes for compatibility tests by updating method names and refactoring how binary paths and table operations are handled in test cases.

  • Renamed update_nodes_configurator to update_configurator_and_restart in the runner.
  • Adjusted binary combinations and refactored test helper functions (renaming read_update_data to upsert_and_check_sum and merging table creation functions) for improved consistency.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ydb/tests/library/harness/kikimr_runner.py Renamed update_nodes_configurator to update_configurator_and_restart to better reflect its behavior.
ydb/tests/functional/compatibility/test_compatibility.py Updated binary combination input patterns and refactored helper functions, with changes to the table creation and update/check logic.

@@ -220,57 +142,28 @@ def read_update_data(self, iteration_count=1, start_index=0):

query_body = "SELECT SUM(value) as sum_value from `sample_table`"
query = ydb.ScanQuery(query_body, {})
it = self.driver.table_client.scan_query(query)
result_set = []
self.execute_scan_query(query_body)[0]['sum_value'] == upsert_count * iteration_count + start_index
Copy link
Preview

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

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

The expression comparing the query result to the expected sum is not being asserted, which may allow failures to go undetected. Add an assertion statement to ensure the result meets the expected value.

Suggested change
self.execute_scan_query(query_body)[0]['sum_value'] == upsert_count * iteration_count + start_index
assert self.execute_scan_query(query_body)[0]['sum_value'] == upsert_count * iteration_count + start_index, \
f"Expected sum_value to be {upsert_count * iteration_count + start_index}, but got {self.execute_scan_query(query_body)[0]['sum_value']}"

Copilot uses AI. Check for mistakes.

with ydb.SessionPool(self.driver, size=1) as pool:
with pool.checkout() as session:
store_type.upper()
Copy link
Preview

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

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

[nitpick] The standalone call to store_type.upper() does not modify state or affect subsequent logic. Consider removing this redundant line to avoid confusion.

Suggested change
store_type.upper()

Copilot uses AI. Check for mistakes.

Copy link

github-actions bot commented Apr 30, 2025

🟢 2025-04-30 15:59:09 UTC The validation of the Pull Request description is successful.

Copy link

github-actions bot commented Apr 30, 2025

2025-04-30 15:19:42 UTC Pre-commit check linux-x86_64-release-asan for 0e5f557 has started.
2025-04-30 15:19:54 UTC Artifacts will be uploaded here
2025-04-30 15:22:13 UTC ya make is running...
2025-04-30 15:24:15 UTC Check cancelled

Copy link

github-actions bot commented Apr 30, 2025

2025-04-30 15:27:58 UTC Pre-commit check linux-x86_64-release-asan for b64a093 has started.
2025-04-30 15:28:06 UTC Artifacts will be uploaded here
2025-04-30 15:30:32 UTC ya make is running...
🟡 2025-04-30 16:10:43 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
2148 2078 0 18 42 10

2025-04-30 16:11:02 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-04-30 16:32:51 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
348 (only retried tests) 307 0 10 21 10

2025-04-30 16:33:07 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-04-30 16:54:00 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
303 (only retried tests) 250 0 13 30 10

🟢 2025-04-30 16:54:11 UTC Build successful.
🟢 2025-04-30 16:54:33 UTC ydbd size 3.8 GiB changed* by +43.1 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: 9c0e538 merge: b64a093 diff diff %
ydbd size 4 122 199 576 Bytes 4 122 243 680 Bytes +43.1 KiB +0.001%
ydbd stripped size 1 428 899 736 Bytes 1 428 913 816 Bytes +13.8 KiB +0.001%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Apr 30, 2025

2025-04-30 15:36:09 UTC Pre-commit check linux-x86_64-relwithdebinfo for b64a093 has started.
2025-04-30 15:36:20 UTC Artifacts will be uploaded here
2025-04-30 15:38:40 UTC ya make is running...
🟡 2025-04-30 16:27:08 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
5356 5217 0 4 115 20

2025-04-30 16:27:42 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-04-30 16:51:23 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
110 (only retried tests) 95 0 1 0 14

2025-04-30 16:51:33 UTC ya make is running... (failed tests rerun, try 3)
🔴 2025-04-30 17:19:21 UTC Some tests failed, follow the links below.

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
56 (only retried tests) 30 0 2 9 15

🟢 2025-04-30 17:19:28 UTC Build successful.
🟢 2025-04-30 17:19:45 UTC ydbd size 2.2 GiB changed* by +7.2 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: 2380ef5 merge: b64a093 diff diff %
ydbd size 2 343 255 448 Bytes 2 343 262 816 Bytes +7.2 KiB +0.000%
ydbd stripped size 492 712 832 Bytes 492 713 600 Bytes +768 Bytes +0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

self.cluster.update_nodes_configurator(self.config)
time.sleep(60)
versions_on_after = self.get_nodes_version()
if binary_path_before != new_binary_paths:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Тогда видимо на это нужен отдельный тест
не исключаю ситуации, котгра Kikime код даст сбой и все наши тесты compatibility будут зелеными не потому, что все хорошо, а потому что версия не переключилась/ переключилась не так, как ожидается

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Да, но это должен быть тест на harness, а не в каждом тесте отдельно это проверять

Сейчас имхо это скорее плохо проверять: тест от этого усложняется, сложнее читать/поддерживать

[last_stable_binary_path, [last_stable_binary_path, current_binary_path]],
[current_binary_path, last_stable_binary_path],
[current_binary_path, current_binary_path],
[[last_stable_binary_path], [current_binary_path]],
Copy link
Collaborator

Choose a reason for hiding this comment

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

понимаю что это упрощает функцию change_cluster_version и делает параметры в ней однозначным, но мне кажется ценнее, чтобы тест был читаем и легко поддерживаем.

  1. тут за [] тяжелее понять какая версия до и после
[[last_stable_binary_path], [last_stable_binary_path, current_binary_path]],
[[current_binary_path], [last_stable_binary_path]],
[[current_binary_path], [current_binary_path]]
  1. функция все стерпит, а при написании теста приходится множить количество скобок каждый раз при добавление конфигурации

Copy link
Collaborator Author

@maximyurchuk maximyurchuk May 5, 2025

Choose a reason for hiding this comment

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

С моей точки зрения, тест как раз был менее читаем, потому что когда читаешь
[a, [b, c]] может быть непонятно что это за сущности
А когда формат более фиксированный чтение упрощается: множество того что было и множество того что стало.

Ну то есть это именно упрощение чтения/понимания в первую очередь (в том числе и change_cluster_version)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"приходится множить количество скобок каждый раз" -- код читают больше раз, чем его пишут, поэтому тут как раз это норм

query = ydb.ScanQuery(query_body, {})
it = self.driver.table_client.scan_query(query)
result_set = []
assert self.execute_scan_query(query_body)[0]['sum_value'] == upsert_count * iteration_count + start_index
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

@maximyurchuk maximyurchuk May 5, 2025

Choose a reason for hiding this comment

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

Ну тут неконсистентно получается: в других местах с self.execute_scan_query такой проверки нет, да и имхо избыточна она (ну то есть я не уверен, что она что-то в состоянии поймать)

self.config.set_binary_paths(new_binary_paths)
self.cluster.update_nodes_configurator(self.config)
time.sleep(60)
Copy link
Collaborator

Choose a reason for hiding this comment

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

а ты проверял, без sleep тесты работают аналогично? тут я тестирую скорее работу с двумя версиями чем работу в момент переключения, не хочется роста точек нестабильности т.к. за шумом меньше доверия тестам будет

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"работу в момент переключения" -- так у тебя же после этой строчки кластер уже поднят

Единственное, что действительно не хватает -- это self.driver.wait() который происходит в setup обычных тестов

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

Copy link

github-actions bot commented May 5, 2025

2025-05-05 12:00:40 UTC Pre-commit check linux-x86_64-release-asan for b97c1a3 has started.
2025-05-05 12:00:52 UTC Artifacts will be uploaded here
2025-05-05 12:03:18 UTC ya make is running...
🟡 2025-05-05 13:02:15 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
2148 2079 0 12 42 15

2025-05-05 13:02:33 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-05-05 13:22:26 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
345 (only retried tests) 299 0 10 23 13

2025-05-05 13:22:38 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-05-05 13:53:27 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
339 (only retried tests) 297 0 7 21 14

🟢 2025-05-05 13:53:35 UTC Build successful.
🔴 2025-05-05 13:53:53 UTC ydbd size 3.8 GiB changed* by +4.6 MiB, which is >= 2.0 MiB vs main: Alert

ydbd size dash main: cdec7c8 merge: b97c1a3 diff diff %
ydbd size 4 121 667 872 Bytes 4 126 493 056 Bytes +4.6 MiB +0.117%
ydbd stripped size 1 429 111 064 Bytes 1 433 271 000 Bytes +4.0 MiB +0.291%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented May 5, 2025

2025-05-05 12:00:46 UTC Pre-commit check linux-x86_64-relwithdebinfo for b97c1a3 has started.
2025-05-05 12:00:57 UTC Artifacts will be uploaded here
2025-05-05 12:03:20 UTC ya make is running...
🟢 2025-05-05 12:45:54 UTC Tests successful.

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
5356 5216 0 0 123 17

🟢 2025-05-05 12:46:27 UTC Build successful.
🟡 2025-05-05 12:46:45 UTC ydbd size 2.2 GiB changed* by +523.4 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: cdec7c8 merge: b97c1a3 diff diff %
ydbd size 2 342 824 080 Bytes 2 343 360 000 Bytes +523.4 KiB +0.023%
ydbd stripped size 492 762 240 Bytes 493 066 240 Bytes +296.9 KiB +0.062%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@maximyurchuk maximyurchuk enabled auto-merge (squash) May 5, 2025 13:43
@maximyurchuk maximyurchuk merged commit b42804d into ydb-platform:main May 5, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants