Skip to content

Conversation

@vladstepanyuk
Copy link
Collaborator

@vladstepanyuk vladstepanyuk added large-tests Launch large tests for PR blockstore Add this label to run only cloud/blockstore build and tests on PR labels Nov 28, 2025

int main(int argc, char** argv)
{
if (argc < 3) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Давай сюда вставим Y_ABORT_UNLESS под макросом NDEBUG что путь в sys/fs/cgroup?
Тогда в тестах оно стрелять не будет

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

может достаточно будет написать тесты на функции хелперы? ведь бинарь только парсит входные аргументы и вызывает вспомогательные функции

Copy link
Collaborator

Choose a reason for hiding this comment

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

Путь можно в параметре передавать:

blockstore-cgroup-pid-writer --cgroup-base-path 'test-path/cgroup' ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

нужно какую-то защиту иметь что мы меняем только файлы внутри "/sys/fs/cgroup" а так если будем передавать --cgroup-base-path 'test-path/cgroup' снаружи, то любой сможет вызвать этот бинарь и поменять файлы в каких попало директориях

@github-actions
Copy link
Contributor

github-actions bot commented Nov 28, 2025

Note

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

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

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
5971 5966 0 2 0 3 0

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

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

Note

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

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

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
5973 5972 0 0 0 1 0

@vladstepanyuk vladstepanyuk force-pushed the users/vladstepanyuk/issue-4734/0 branch from 72fbfeb to cddacfb Compare December 4, 2025 12:47
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

Note

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

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

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
6004 6003 0 0 0 1 0


int main(int argc, char** argv)
{
if (argc < 3) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Почему бы не заиспользовать last_getopt.h ?

8675fcb

@@ -0,0 +1,39 @@
#include <cloud/blockstore/libs/common/cgroups_helpers.h>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Не уверен, что ради двух мелких функций стоит это делать, особенно в common - можно просто накопипастить.

Copy link
Collaborator Author

@vladstepanyuk vladstepanyuk Dec 8, 2025

Choose a reason for hiding this comment

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

нужно написать какие-то тесты, при этом написать интеграционные тесты, запускающие бинарь не получится, т.к. мы хотим зашить проверку внутрь бинаря на то, что изменяются только файлы внутри /sys/fs/cgroup

и передавать снаружи этот путь нельзя

Copy link
Collaborator

Choose a reason for hiding this comment

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

Передаешь тестовый путь через параметр --cgroup-root-path - пишешь тесты с запуском бинаря. По умолчанию путь на /sys/fs/cgroup - какие проблемы?


int main(int argc, char** argv)
{
if (argc < 3) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Путь можно в параметре передавать:

blockstore-cgroup-pid-writer --cgroup-base-path 'test-path/cgroup' ...

Comment on lines 706 to 713
if (ExternalCgroupsPidWriterBinaryPath) {
AddToCGroupsWithExternalExecutable(
ExternalCgroupsPidWriterBinaryPath,
process.Pid,
Cgroups);
} else {
AddToCGroups(process.Pid, Cgroups);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Это лучше вынести, чтоб не раздувать StartProcess 2ca98f7

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

Note

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

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

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
6004 6003 0 0 0 1 0

@@ -0,0 +1,39 @@
#include <cloud/blockstore/libs/common/cgroups_helpers.h>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Передаешь тестовый путь через параметр --cgroup-root-path - пишешь тесты с запуском бинаря. По умолчанию путь на /sys/fs/cgroup - какие проблемы?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blockstore Add this label to run only cloud/blockstore 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