Integration: Alter TestContainerPids for Windows#8736
Conversation
|
Can we not expect and test for >=N+1? |
|
I've been thinking maybe we change the windows longCommand to 'cmd /c ping -t localhost' so there's two processes we launched, OR we launch an exec for windows in this test and just check that the two (init + exec) processes we launched exist. That changes this test quite a bit to accommodate Windows though. |
kzys
left a comment
There was a problem hiding this comment.
Looks good to me. It is better than what we have (just skipping any checks) at least :)
| // 2 processes, 1 for sh and one for sleep | ||
| if l := len(processes); l != 2 { | ||
| } else { | ||
| if l != 2 { |
There was a problem hiding this comment.
Can you put the comment back here? ("2 processes, 1 for sh and one for sleep")
There was a problem hiding this comment.
Yep! I honestly missed that I nuked the comment..
The point of this test is to see that we successfully can get all of the pids running in the container and they match the number expected, but for Windows this concept is a bit different. Windows containers essentially go through the usermode boot phase of the operating system, and have quite a few processes and system services running outside of the "init" process you specify. Because of this, there's not a great way to say "there should only be N processes running" like we can ensure for Linux. So, on Windows check that we're at least greater than one. Signed-off-by: Danny Canter <[email protected]>
0e73ac9 to
3c1e7ff
Compare
…h upstream containerd/main update fork-external/main branch to upstream containerd/main at commit f90f80d Related work items: containerd#8736, containerd#8861, containerd#8924, containerd#8934, containerd#9027, containerd#9076, containerd#9104, containerd#9118, containerd#9141, containerd#9155, containerd#9177, containerd#9183, containerd#9184, containerd#9186, containerd#9187, containerd#9191, containerd#9200, containerd#9205, containerd#9211, containerd#9214, containerd#9215, containerd#9221, containerd#9223, containerd#9228, containerd#9231, containerd#9234, containerd#9242, containerd#9246, containerd#9247, containerd#9251, containerd#9253, containerd#9254, containerd#9255, containerd#9268
The point of this test is to see that we successfully can get all of the pids running in the container and they match the number expected, but for Windows this concept is a bit different. Windows containers essentially go through the usermode boot phase of the operating system, and have quite a few processes and system services running outside of the "init" process you specify. Because of this, there's not a great way to say "there should only be N processes running" like we can ensure
for Linux.
With all that said, on Windows check that we're at least greater than one ("init"+system services).