-
Notifications
You must be signed in to change notification settings - Fork 0
fix jobmanager tests #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughTracing instrumentation is added to three S3 storage methods without altering control flow. Additionally, test storage initialization is refactored to wrap storage backends with a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
crates/icegate-jobmanager/src/tests/two_jobs_test.rs (1)
108-129: Minor: Unnecessary clone when casting to trait object.On line 127,
storage.clone()creates an unnecessaryArcclone. Thestoragevariable is already anArc<S3Storage>and can be directly cast without cloning since ownership is transferred immediately.♻️ Suggested fix
let storage = Arc::new(CachedStorage::new( - storage.clone() as Arc<dyn Storage>, + storage as Arc<dyn Storage>, Metrics::new_disabled(), ));crates/icegate-jobmanager/src/tests/deadline_expiry_test.rs (1)
75-96: Minor: Unnecessary clone when casting to trait object.Same as in
two_jobs_test.rs, line 94'sstorage.clone()is unnecessary since ownership is transferred immediately.♻️ Suggested fix
let storage = Arc::new(CachedStorage::new( - storage.clone() as Arc<dyn Storage>, + storage as Arc<dyn Storage>, Metrics::new_disabled(), ));
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
crates/icegate-jobmanager/src/storage/s3.rscrates/icegate-jobmanager/src/tests/deadline_expiry_test.rscrates/icegate-jobmanager/src/tests/two_jobs_test.rs
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{rs,toml}
📄 CodeRabbit inference engine (AGENTS.md)
Use
cargo buildfor debug builds,cargo build --releasefor release builds, and specific binary builds withcargo build --bin <name>
Files:
crates/icegate-jobmanager/src/storage/s3.rscrates/icegate-jobmanager/src/tests/deadline_expiry_test.rscrates/icegate-jobmanager/src/tests/two_jobs_test.rs
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Run all tests withcargo test, specific tests withcargo test test_name, and use--nocaptureflag to show test output
Usemake fmtto check code format; DO NOT run via rustup because it doesn't respect rustfmt.toml
Usemake clippyto run the linter with warnings as errors
Runmake auditto perform security audits and usemake installto install cargo-audit
Runmake cito execute all CI checks (check, fmt, clippy, test, audit)
Use rustfmt for code formatting with configuration in rustfmt.toml
Files:
crates/icegate-jobmanager/src/storage/s3.rscrates/icegate-jobmanager/src/tests/deadline_expiry_test.rscrates/icegate-jobmanager/src/tests/two_jobs_test.rs
**/*.{rs,toml,md}
📄 CodeRabbit inference engine (AGENTS.md)
Ensure each file ends with a newline; do not duplicate if it already exists
Files:
crates/icegate-jobmanager/src/storage/s3.rscrates/icegate-jobmanager/src/tests/deadline_expiry_test.rscrates/icegate-jobmanager/src/tests/two_jobs_test.rs
🧬 Code graph analysis (2)
crates/icegate-jobmanager/src/storage/s3.rs (2)
crates/icegate-jobmanager/src/core/job.rs (1)
version(342-344)crates/icegate-jobmanager/src/tests/common/in_memory_storage.rs (1)
version(25-27)
crates/icegate-jobmanager/src/tests/deadline_expiry_test.rs (3)
crates/icegate-jobmanager/src/tests/common/manager_env.rs (2)
storage(90-92)new(16-33)crates/icegate-jobmanager/src/storage/s3.rs (1)
new(100-162)crates/icegate-jobmanager/src/storage/cached.rs (1)
new(26-32)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Benchmark
- GitHub Check: Build Release
- GitHub Check: Test beta on ubuntu-latest
- GitHub Check: Security Audit
- GitHub Check: Test stable on ubuntu-latest
🔇 Additional comments (9)
crates/icegate-jobmanager/src/storage/s3.rs (3)
429-430: LGTM!Tracing instrumentation is correctly applied. Skipping
selfandcancel_tokenis appropriate, and recordingjob_versionfromjob_meta.versionprovides useful context for debugging storage operations.
470-471: LGTM!The instrumentation correctly captures
job_codeas the identifying field for this operation, which aligns well with the method's purpose of finding job metadata by code.
514-515: LGTM!Good choice to skip the
jobparameter to avoid serializing the entire job structure in traces. Capturingjob_versionfromjob.version()provides the necessary context for debugging save operations.crates/icegate-jobmanager/src/tests/two_jobs_test.rs (2)
14-20: LGTM!The new imports for
Storagetrait andCachedStoragewrapper are correctly added to support the refactored storage initialization pattern.
142-147: LGTM!Storage is correctly passed to
ManagerEnv::newwithout additional Arc wrapping, matching the expected signaturestorage: Arc<dyn Storage>per the relevant code snippets.crates/icegate-jobmanager/src/tests/deadline_expiry_test.rs (4)
14-20: LGTM!The imports correctly mirror the pattern established in
two_jobs_test.rsfor theStoragetrait andCachedStoragewrapper.
22-22: LGTM!The doc comment correctly describes the test's purpose of verifying task re-picking after deadline expiry.
98-109: LGTM!The worker count increase and comment explaining the rationale for "small resources system" is helpful context. Storage is correctly passed to
ManagerEnv.
128-134: [No action required - method exists]The
attempts()method is properly defined on the Task type. Line 102 declares it in theImmutableTasktrait, and line 343 contains its implementation. The test code on line 129 is correct and will compile without errors.Likely an incorrect or invalid review comment.
Reference: failed ci/cd test.
Summary by CodeRabbit
Observability
Tests
✏️ Tip: You can customize this high-level summary in your review settings.