Add resilience test coverage for frozen kernel, backpressure, and re-auth flow#52
Add resilience test coverage for frozen kernel, backpressure, and re-auth flow#52
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09039ec872
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| let queue_peak = runtime.queue_peak().await; | ||
| drop(runtime); | ||
| sleep(Duration::from_millis(250)).await; |
There was a problem hiding this comment.
Replace fixed sleep with completion synchronization
This assertion depends on a hard-coded 250ms delay instead of waiting for the worker task to finish draining the channel, so the test can fail nondeterministically on slower or contended CI runners even when the runtime is correct. In this test we enqueue 5,000 capsules and then assert exact processed count; without an explicit completion signal (e.g., joining the worker/drain future), timing variance makes the suite flaky and violates the deterministic-resilience coverage goal.
Useful? React with 👍 / 👎.
Motivation
Description
tests/agent_resilience.rsimplementing aFakeKernelandAgentRuntimeto simulate kernel status, bounded worker concurrency, and agent queueing semantics.ClaimCapsulesubmissions to validate backpressure and bounded in-flight concurrency, and re-authentication after a ledger reset to ensure frozen-session state is cleared.discos-clientcrate by adding a[[test]]entry incrates/discos-client/Cargo.tomlso the integration runs with crate tests.Testing
cargo fmt --checkand it succeeded.cargo clippy --workspace --all-targets -- -D warningsand it succeeded.cargo test -p discos-client --test agent_resilienceand the added resilience suite passed (3 tests Ok).cargo test --workspacewhich exercises the whole workspace; the new tests did not cause the overall failure but the full workspace run failed due to pre-existingdiscos-coregolden-vector test failures unrelated to these changes (twotopicidgolden-vector tests).Codex Task