Skip to content

integration: revisit TestIssue9103#9337

Closed
samuelkarp wants to merge 1 commit intocontainerd:mainfrom
samuelkarp:issue-9334-main
Closed

integration: revisit TestIssue9103#9337
samuelkarp wants to merge 1 commit intocontainerd:mainfrom
samuelkarp:issue-9334-main

Conversation

@samuelkarp
Copy link
Copy Markdown
Member

Container execution and task context timeout are both set to 30 seconds, which introduces the opportunity for a race condition. Allow the container to run indefinitely (sleep inf) so that an exit does not race with the task timeout.

I think this helps with #9334. This same commit against release/1.6 seems to be more reliable (I reran CI on #9335 several times to check). Opening this against main and then will cherry-pick back.

Container execution and task context timeout are both set to 30 seconds,
which introduces the opportunity for a race condition.  Allow the
container to run indefinitely (sleep inf) so that an exit does not race
with the task timeout.

Signed-off-by: Samuel Karp <[email protected]>
@samuelkarp samuelkarp requested review from fuweid and kzys November 3, 2023 22:28
cntrOpts: []NewContainerOpts{
WithNewSpec(oci.WithImageConfig(image),
withProcessArgs("sleep", "30"),
withProcessArgs("sleep", "inf"),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IIUC the container task was never started in this test case, wonder why would this make a difference?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes. The test case just calls NewTask so that the runc-init is still waiting for signal from task.Start.
When the handleProcessExit doesn't have chance to update the status, the task.Status will return Created status. So I think we can use task.Wait to ensure that we can get stopped status when the expectedStatus is stopped.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, I missed this.

@ruiwen-zhao
Copy link
Copy Markdown
Member

Can you elaborate on the race condition here? How would the 30s-sleep race with the task context timeout?

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.

5 participants