Skip to content

Conversation

@mregrock
Copy link
Collaborator

Changelog entry

Fix flaky v2 auth test

Changelog category

  • Not for changelog (changelog entry is not required)

Description for reviewers

...

@mregrock mregrock requested a review from Copilot October 31, 2025 11:00
@github-actions
Copy link

🟢 2025-10-31 11:04:16 UTC The validation of the Pull Request description is successful.

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

2025-10-31 11:04:26 UTC Pre-commit check linux-x86_64-release-asan for 0d6eec1 has started.
2025-10-31 11:04:44 UTC Artifacts will be uploaded here
2025-10-31 11:06:04 UTC ya make is running...
🟢 2025-10-31 12:12:32 UTC ydbd size 3.8 GiB changed* by +7.3 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: 9ca5b3c merge: 0d6eec1 diff diff %
ydbd size 4 063 314 504 Bytes 4 063 321 992 Bytes +7.3 KiB +0.000%
ydbd stripped size 1 508 297 656 Bytes 1 508 300 088 Bytes +2.4 KiB +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
2025-10-31 12:12:34 UTC Check cancelled

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

2025-10-31 11:05:13 UTC Pre-commit check linux-x86_64-relwithdebinfo for 0d6eec1 has started.
2025-10-31 11:05:30 UTC Artifacts will be uploaded here
2025-10-31 11:06:52 UTC ya make is running...
🟢 2025-10-31 11:53:30 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
7170 7026 0 0 130 14

🟢 2025-10-31 11:53:36 UTC Build successful.
🟢 2025-10-31 11:53:49 UTC ydbd size 2.3 GiB changed* by +4.1 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: 0cbb971 merge: 0d6eec1 diff diff %
ydbd size 2 426 561 136 Bytes 2 426 565 360 Bytes +4.1 KiB +0.000%
ydbd stripped size 515 717 512 Bytes 515 718 280 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

Copy link
Contributor

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 modifies the _get_token and __call_ydb_cli methods in the KiKiMR test harness to improve token retrieval reliability and authentication handling. The changes add retry logic for token retrieval and modify how certificates and token files are handled in CLI calls.

  • Added retry mechanism with timeout and interval parameters to _get_token method
  • Removed use_certs parameter from __call_ydb_cli and simplified certificate and token handling logic
  • Changed token priority order in __call_ydb_cli to exclude self.root_token from fallback chain

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

root_token_file = tempfile.NamedTemporaryFile(dir=self.__configurator.working_dir, delete=False)
root_token_file.write(self.root_token.encode('utf-8'))
root_token_file.close()
full_command += ['--token-file', self.root_token_file]
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

Variable reference error: self.root_token_file is used but not defined. The local variable created on line 457 is root_token_file (without self.). This should be root_token_file.name to reference the file path.

Suggested change
full_command += ['--token-file', self.root_token_file]
full_command += ['--token-file', root_token_file.name]

Copilot uses AI. Check for mistakes.
except Exception as e:
last_exception = e
time.sleep(interval)
raise last_exception
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

When the timeout is exceeded and no exception was caught (e.g., if timeout=0), last_exception will be None, causing raise None which results in a TypeError. Add a check to raise a meaningful exception if last_exception is None, such as raise TimeoutError(f'Failed to get token within {timeout} seconds').

Suggested change
raise last_exception
if last_exception is not None:
raise last_exception
else:
raise TimeoutError(f'Failed to get token within {timeout} seconds')

Copilot uses AI. Check for mistakes.
Comment on lines 457 to 459
root_token_file = tempfile.NamedTemporaryFile(dir=self.__configurator.working_dir, delete=False)
root_token_file.write(self.root_token.encode('utf-8'))
root_token_file.close()
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

The temporary token file created here is never cleaned up (delete=False), which can lead to accumulation of temporary files. Consider using a context manager or storing the file path as an instance variable to enable cleanup in a teardown method.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Oct 31, 2025

2025-10-31 12:13:58 UTC Pre-commit check linux-x86_64-release-asan for c3c94cb has started.
2025-10-31 12:14:17 UTC Artifacts will be uploaded here
2025-10-31 12:15:42 UTC ya make is running...
🟡 2025-10-31 13:54:55 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
3173 2975 0 37 142 19

🟢 2025-10-31 13:55:01 UTC Build successful.
🟢 2025-10-31 13:55:21 UTC ydbd size 3.8 GiB changed* by +13.7 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: a04e6ba merge: c3c94cb diff diff %
ydbd size 4 063 322 088 Bytes 4 063 336 104 Bytes +13.7 KiB +0.000%
ydbd stripped size 1 508 300 152 Bytes 1 508 307 832 Bytes +7.5 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

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

2025-10-31 12:15:21 UTC Pre-commit check linux-x86_64-relwithdebinfo for c3c94cb has started.
2025-10-31 12:15:38 UTC Artifacts will be uploaded here
2025-10-31 12:16:59 UTC ya make is running...
🟡 2025-10-31 13:27:04 UTC Some tests failed, follow the links below. Going to retry failed tests...

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
7170 7025 0 2 130 13

2025-10-31 13:27:10 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-10-31 13:32:03 UTC Tests successful.

Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
29 (only retried tests) 19 0 0 0 10

🟢 2025-10-31 13:32:05 UTC Build successful.
🟢 2025-10-31 13:32:20 UTC ydbd size 2.3 GiB changed* by +4.6 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: a04e6ba merge: c3c94cb diff diff %
ydbd size 2 426 565 360 Bytes 2 426 570 096 Bytes +4.6 KiB +0.000%
ydbd stripped size 515 718 280 Bytes 515 719 560 Bytes +1.2 KiB +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

@mregrock mregrock enabled auto-merge (squash) October 31, 2025 15:13
@mregrock mregrock merged commit 37369f2 into ydb-platform:main Oct 31, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants