fix: Add return for job with multiple results - #49
Conversation
WalkthroughThis pull request introduces support for multi-result tasks in the Spider framework. The changes enable the Changes
Sequence DiagramsequenceDiagram
participant Client
participant Driver
participant Worker
participant Task
Client->>Driver: start job with swap_test
Driver->>Worker: execute swap_test
Worker->>Task: process swap_test(1, 2)
Task-->>Worker: return (2, 1)
Worker-->>Driver: complete job
Driver-->>Client: return result tuple
Possibly Related PRs
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/client/client-test.cpp (1)
92-108: Enhance error message clarity.The error message could be more descriptive by explaining what went wrong. Consider including the reason for the failure.
- "Wrong multiple result job result. Get ({}, {}). Expect (2, 1)", + "Multiple result job returned incorrect values. Got ({}, {}) but expected (2, 1). The swap operation may have failed.",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/spider/client/Job.hpp(1 hunks)tests/client/client-test.cpp(2 hunks)tests/worker/worker-test.cpp(3 hunks)tests/worker/worker-test.hpp(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: non-storage-unit-tests (ubuntu-24.04)
- GitHub Check: lint
- GitHub Check: non-storage-unit-tests (ubuntu-22.04)
🔇 Additional comments (2)
tests/worker/worker-test.hpp (1)
4-4: LGTM! Clean and consistent implementation.The changes follow the project's conventions and properly declare the new functionality for handling multiple results.
Also applies to: 11-11
tests/worker/worker-test.cpp (1)
6-6: LGTM! Clean implementation with proper task registration.The swap_test implementation is straightforward and correctly registered within the framework.
Also applies to: 19-21, 66-66
| output_index = 0; | ||
| } | ||
| }); | ||
| return result; |
There was a problem hiding this comment.
LGTM! Critical fix for tuple result handling.
Added the missing return statement for tuple specialization case, which is essential for the multiple results functionality to work correctly.
Description
As title.
Validation performed
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests
These updates improve the system's flexibility in handling task returns and expand the capabilities of job processing.