Repository navigation
Implementing test for graceful and immediate process termination - #1074
SimonKozik wants to merge 10 commits into
Conversation
| // No real child process is created; the parent path in ProcessLauncher stores | ||
| // the returned pid and returns kSuccess. | ||
| EXPECT_CALL(*g_syscall_mock, access(_, _)).WillRepeatedly(Return(0)); | ||
| EXPECT_CALL(*g_syscall_mock, fork()).WillOnce(Return(kFakePid)); |
There was a problem hiding this comment.
hmm tbh I was thinking in the CTs we shouldn't mock the syscalls. I don't think this would fail so what do you think?
There was a problem hiding this comment.
In general, I don't see a reason to prohibit syscall mocks in CT tests. Mocks are a way to define test boundaries, and since CTs don't test the entire system, there will always be boundaries somewhere.
It seems strange to argue that syscalls are a boundary we should never mock.
Additionally, I chose a CT test because I believe it's important to verify that LM sends the correct signal, not just that the target process terminates.
For example, LM could theoretically send SIGLOST instead of SIGKILL. If the process uses the default signal handler, it would still terminate, and a test checking only for process termination could pass.
To verify that LM actually sends SIGKILL, we need to mock the syscall. Since SIGKILL cannot be caught, blocked, or ignored by the target process, we cannot verify the exact signal through a signal handler.
ee67092 to
aa0b498
Compare
ea700b4 to
ad09209
Compare
|
Documentation preview for this pull request is available at: |
2a4ad2b to
c38eb16
Compare
deployment_config.shutdown_timeout_msis observed.shutdown_timeout_msto be set to zero and thus enabling rapid shutdown of components if needed.