Skip to content

ROX-33568: retry logic to container spawn in integration-tests - #3726

Open
ovalenti wants to merge 3 commits into
masterfrom
ovalenti/container_launch_retry
Open

ROX-33568: retry logic to container spawn in integration-tests#3726
ovalenti wants to merge 3 commits into
masterfrom
ovalenti/container_launch_retry

Conversation

@ovalenti

@ovalenti ovalenti commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

There are sporadic failures when starting containers during integration tests.

2026/01/23 07:32:41 INFO: start external-connection with quay.io/rhacs-eng/qa-multi-arch:alpine-curl-2.0.5 (dcd32a1451f7)
    base.go:74: 
        	Error Trace:	/home/runner/work/collector/collector/integration-tests/suites/base.go:74
        	            				/home/runner/work/collector/collector/integration-tests/suites/runtime_config_file.go:115
        	            				/home/runner/go/pkg/mod/github.com/stretchr/testify@v1.9.0/suite/suite.go:192
        	Error:      	Received unexpected error:
        	            	Error response from daemon: runc: runc create failed: unable to start container process: error during container init: error setting cgroup config for procHooks process: unable to freeze: OCI runtime error
        	            	start collector
        	            	github.com/stackrox/collector/integration-tests/pkg/executor.(*dockerAPIExecutor).StartContainer
        	            		/home/runner/work/collector/collector/integration-tests/pkg/executor/executor_docker_api.go:159
        	            	github.com/stackrox/collector/integration-tests/pkg/collector.(*DockerCollectorManager).launchCollector
        	            		/home/runner/work/collector/collector/integration-tests/pkg/collector/collector_docker.go:149
        	            	github.com/stackrox/collector/integration-tests/pkg/collector.(*DockerCollectorManager).Launch
        	            		/home/runner/work/collector/collector/integration-tests/pkg/collector/collector_docker.go:81
        	            	github.com/stackrox/collector/integration-tests/suites.(*IntegrationTestSuiteBase).StartCollector
        	            		/home/runner/work/collector/collector/integration-tests/suites/base.go:74
        	            	github.com/stackrox/collector/integration-tests/suites.(*RuntimeConfigFileTestSuite).SetupTest
        	            		/home/runner/work/collector/collector/integration-tests/suites/runtime_config_file.go:115
        	            	github.com/stretchr/testify/suite.Run.func1
        	            		/home/runner/go/pkg/mod/github.com/stretchr/testify@v1.9.0/suite/suite.go:192
        	            	testing.tRunner
        	            		/home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.6.linux-amd64/src/testing/testing.go:1690
        	            	runtime.goexit
        	            		/home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.6.linux-amd64/src/runtime/asm_amd64.s:1700
        	Test:       	TestRuntimeConfigFile/TestRuntimeConfigFileDisable

A previous fix attempt as been made by waiting on the status of the freshly created container, but the failure can still be observed. #2818

We revert the previous change and implement a brute retry of the Start operation.

@ovalenti ovalenti self-assigned this Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Containers now start immediately during execution, reducing unnecessary delays.
    • Improved handling of container startup errors and readiness checks.

Walkthrough

StartContainer now starts the created container through RetryWithTimeout. It returns startup errors before readiness inspection and no longer waits for container termination.

Changes

Container startup flow

Layer / File(s) Summary
Start container before readiness inspection
integration-tests/pkg/executor/executor_docker_api.go
ContainerStart now runs inside the retry callback. The pre-start termination wait was removed. Wrapped start errors are returned before readiness inspection.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the failure and implementation, but it omits the required Checklist and Testing Performed sections. Add the Checklist and Testing Performed sections, including applicable test results and any reasons for skipped items.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the retry logic added for integration-test container startup.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ovalenti/container_launch_retry

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@integration-tests/pkg/executor/executor_docker_api.go`:
- Around line 160-164: Update the RetryWithTimeout callback around
ContainerStart so ContainerStart is attempted only until its first successful
response; afterward, readiness retries must call only ContainerInspect. Return
non-zero container exits as terminal errors rather than restarting the
container, and add coverage asserting an inspection failure results in exactly
one ContainerStart call.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 718a1035-7677-41c9-ad4c-ce2bf4615617

📥 Commits

Reviewing files that changed from the base of the PR and between e1d43f0 and 235d33d.

📒 Files selected for processing (1)
  • integration-tests/pkg/executor/executor_docker_api.go

Comment thread integration-tests/pkg/executor/executor_docker_api.go
@codecov-commenter

codecov-commenter commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 27.43%. Comparing base (e1d43f0) to head (5c4c2ab).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3726   +/-   ##
=======================================
  Coverage   27.43%   27.43%           
=======================================
  Files          94       94           
  Lines        5406     5406           
  Branches     2535     2535           
=======================================
  Hits         1483     1483           
  Misses       3198     3198           
  Partials      725      725           
Flag Coverage Δ
collector-unit-tests 27.43% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@ovalenti
ovalenti marked this pull request as ready for review August 6, 2026 14:07
@ovalenti
ovalenti requested a review from a team as a code owner August 6, 2026 14:07
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.

2 participants