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

agent: fix UT failures due to chdir #814

Merged
merged 2 commits into from
Sep 28, 2020

Conversation

bergwolf
Copy link
Member

@bergwolf bergwolf commented Sep 28, 2020

Current working directory is a process level resource. We cannot call
chdir in parallel from multiple threads, which would cause cwd confusion
and result in UT failures.

The agent code itself is correct that chdir is only called from spawned
child init process. Well, there is one exception that it is also called
in do_create_container() but it is safe to assume that containers are
never created in parallel (at least for now).

Fixes: #782

@bergwolf bergwolf added the wip Work in Progress (PR incomplete - needs more work or rework) label Sep 28, 2020
Current working directory is a process level resource. We cannot call
chdir in parallel from multiple threads, which would cause cwd confusion
and result in UT failures.

The agent code itself is correct that chdir is only called from spawned
child init process. Well, there is one exception that it is also called
in do_create_container() but it is safe to assume that containers are
never created in parallel (at least for now).

Fixes: kata-containers#782
Signed-off-by: Peng Tao <[email protected]>
@bergwolf bergwolf changed the title wip/debug/agent: make init_rootfs test robust agent: fix UT failures due to chdir Sep 28, 2020
@bergwolf bergwolf removed the wip Work in Progress (PR incomplete - needs more work or rework) label Sep 28, 2020
As it is auto-generated.

Signed-off-by: Peng Tao <[email protected]>
@bergwolf
Copy link
Member Author

/test-ubuntu

@bergwolf
Copy link
Member Author

/test-clh

@liubin liubin merged commit 7e7d4c8 into kata-containers:2.0-dev Sep 28, 2020
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.

3 participants