Repository navigation
Description
User Story
I maintain OpenShell and run the Kubernetes Rust smoke lanes on my PRs. One test, credential_gating, regularly turns those lanes red on PRs that don't touch credentials, providers or the Kubernetes driver, so I have to rerun jobs to get a green result.
Description
e2e/rust/tests/credential_gating.rs credentialed_endpoint_gates_work_end_to_end keeps hitting the nextest 300 s cap on the Kubernetes Rust smoke lanes (Agent Sandbox v1alpha1 and v1beta1). The test isn't hanging. Its normal runtime on Kubernetes is already close to the cap:
- Passing runs take more than 180 s, and most take more than 240 s.
- On Docker it takes about 50 s, and on Podman about 75 s.
It is the most common cause of red Kubernetes Rust smoke jobs.
Where the time goes
The test runs these steps one after another, in a single test function:
- six full sandbox lifecycles (create, wait for Ready, exec, delete)
- two
policy set --waitcalls
On Kubernetes each lifecycle costs a pod schedule, an image pull or cache check, and supervisor startup. The test uses a fixed provider name and profile ID (PROVIDER_NAME = PROFILE_ID = "e2e-credential-gating"), so its steps can't simply run in parallel.
The cap is in .config/nextest.toml:
[profile.e2e-kubernetes]
status-level = "slow"
# Flag slow tests after 60s and terminate them after five minutes.
slow-timeout = { period = "60s", terminate-after = 5 }Context
Evidence
Scan scope:
- Every Branch E2E Checks run created on or after 2026-10-19: 626 runs.
- Coverage is partial: 18 runs couldn't be fetched because of repeated GitHub API 502s.
Kubernetes Rust smoke jobs that completed (success or failure):
| Lane | Jobs | credential_gating TIMEOUT |
|---|---|---|
| Agent Sandbox v1alpha1 | 277 | 14 |
| Agent Sandbox v1beta1 | 277 | 14 |
| Kubernetes HA (Rust smoke) | 18 | 0 |
- Total: 28 timeouts in 554 Agent Sandbox jobs (5%). 28 of the 280 run attempts (10%) had at least one.
- Spread: 24 PRs, from 2026-10-19 to 2026-11-04.
- Share of failures: 28 of the 38 failed Kubernetes smoke jobs were this test. The other 10 were seven failures of six other tests (in
sandbox_lifecycle,ssh_host_identity,ephemeral_cleanupandsandbox_labels) and three infrastructure failures. They are out of scope here. - Duration: every timeout was at 300.005–300.009 s, which is the cap and not a crash.
- Docker and Podman Rust E2E lanes: no failures of this test in an earlier scan.
- VM lanes don't run this test, and Release Dev has no Kubernetes smoke lane.
Passing durations on Kubernetes come from an earlier scan of 50 passing runs:
- All 50 took over 180 s, and 45 took over 240 s.
- Docker took 47–53 s and Podman 68–83 s.
- The latest data point: on test(e2e): migrate the features and drivers suites to testkit #5137
57496136c(run 41752143964, job 126324084818, v1alpha1), the test passed but was flaggedSLOW [>240.000s].
All 28 timeouts (TIMEOUT [300.00Xs] openshell-e2e::credential_gating credentialed_endpoint_gates_work_end_to_end)
| Run | Attempt | Job | PR | SHA | Started (UTC) | Lane |
|---|---|---|---|---|---|---|
| 39313138493 | 1 | 118273500796 | #3292 | afae92c | 2026-10-19 19:55 | v1beta1 |
| 39402457256 | 2 | 118564834026 | #4742 | f5a6636 | 2026-10-20 09:52 | v1beta1 |
| 39397805331 | 2 | 118637994070 | #4741 | ca0a0e2 | 2026-10-20 12:55 | v1beta1 |
| 39446992847 | 1 | 118716050882 | #3292 | 0c11066 | 2026-10-20 15:26 | v1alpha1 |
| 39457218271 | 1 | 118751698657 | #4656 | 15f537f | 2026-10-20 16:34 | v1beta1 |
| 39479839752 | 2 | 118918291540 | #4760 | 3d1a5ed | 2026-10-20 22:19 | v1alpha1 |
| 39507249880 | 1 | 118922987143 | #4764 | 3f6df92 | 2026-10-20 22:29 | v1beta1 |
| 39785394892 | 1 | 119861631801 | #4801 | 59c472f | 2026-10-22 13:45 | v1alpha1 |
| 39822577382 | 1 | 119986505932 | #4678 | 445072c | 2026-10-22 17:44 | v1beta1 |
| 39869556319 | 1 | 120144280533 | #3292 | b7f666c | 2026-10-22 23:21 | v1alpha1 |
| 39409836733 | 2 | 120686192554 | #4744 | c8afb73 | 2026-10-23 22:23 | v1beta1 |
| 40402056078 | 1 | 121867302345 | #4774 | 270c660 | 2026-10-26 21:46 | v1beta1 |
| 40030261085 | 2 | 121911501940 | #4886 | 8531c4b | 2026-10-26 23:28 | v1beta1 |
| 40452253268 | 1 | 122019783541 | #4774 | ff09b71 | 2026-10-27 05:02 | v1alpha1 |
| 40529067037 | 1 | 122282705723 | #4565 | 12f73d0 | 2026-10-27 15:27 | v1alpha1 |
| 40583982265 | 1 | 122478522674 | #4773 | 6cf04de | 2026-10-27 21:24 | v1beta1 |
| 40675338173 | 1 | 122776775027 | #4996 | 879a2e4 | 2026-10-28 11:25 | v1alpha1 |
| 40883419679 | 1 | 123488046352 | #5030 | 9dcf456 | 2026-10-29 13:53 | v1beta1 |
| 40903494299 | 1 | 123571308171 | #4891 | 27342cb | 2026-10-29 16:11 | v1beta1 |
| 41129080278 | 1 | 124327002405 | #4744 | 01e7d8f | 2026-10-30 21:40 | v1beta1 |
| 41465162941 | 1 | 125355602181 | #5120 | 955284b | 2026-11-02 15:10 | v1alpha1 |
| 41545447731 | 2 | 125634409345 | #5099 | 62f30d9 | 2026-11-03 00:02 | v1alpha1 |
| 41566460918 | 1 | 125691740031 | #5138 | 8835ce6 | 2026-11-03 02:38 | v1alpha1 |
| 41630227349 | 1 | 125910125999 | #5117 | de0645c | 2026-11-03 12:14 | v1alpha1 |
| 41630321722 | 1 | 125913689539 | #5115 | 84eafe7 | 2026-11-03 12:21 | v1alpha1 |
| 41631801818 | 2 | 125915245928 | #5204 | 760396e | 2026-11-03 12:25 | v1alpha1 |
| 41683851883 | 1 | 126095364812 | #4914 | 308bb8e | 2026-11-03 17:46 | v1beta1 |
| 41792624429 | 1 | 126454872091 | #5121 | eb7552d | 2026-11-04 07:45 | v1alpha1 |
Logs: gh api repos/NVIDIA/OpenShell/actions/jobs/<job>/logs.
Proposed fix
- Split the test into independent tests, one per gated-endpoint scenario. Give each test its own provider name and profile ID, for example suffixed with a run ID, so nextest can run them in parallel and each one fits easily under the cap.
- Progress output: print a progress line to stderr for each lifecycle step. A future timeout then shows which step was slow; today a TIMEOUT gives no hint.
A per-test nextest override that raises the cap for this test would hide the problem rather than fix it, so it isn't part of this proposal.
Reproduce / verify
- Reproduce: run the Kubernetes Rust smoke lane (
kubernetes-e2e, Agent Sandbox v1alpha1/v1beta1) a few times. About 1 in 10 run attempts hits the timeout. Passing runs showSLOW [>240.000s]for this test. - Verify a fix: on the Kubernetes lanes each split test finishes well under the cap with no
SLOW [>240s]flag. A repeat scan like the one above then shows no credential_gating TIMEOUTs.
Definition of Done
-
credential_gatingcoverage is split into independent tests with unique provider and profile names, and each cleans up its own resources on failure. - Each split test prints per-step progress to stderr.
- Each split test finishes well under the 300 s cap on both Agent Sandbox Kubernetes smoke lanes, with coverage unchanged.
- No per-test timeout override is added for
credential_gating.
Activity