Summary
Write integration tests that wire `ThreadPoolExecutor` through the full `TraverseRuntime` stack — registry, router, placement, trace — and verify end-to-end correctness under concurrent load. These tests live in `crates/traverse-runtime/tests/thread_pool_integration.rs`.
Governing Spec
- `047-thread-pool-executor`
Blocked by
Test inventory
Drop-in replacement
| Test name |
What it proves |
| `native_executor_and_thread_pool_produce_identical_output` |
Same capability, same input — `NativeExecutor` and `ThreadPoolExecutor` return byte-identical `Value` output |
| `thread_pool_executor_satisfies_capability_executor_trait_object` |
`Box` can hold a `ThreadPoolExecutor` — compiles and executes |
Router integration
| Test name |
What it proves |
| `router_routes_to_thread_pool_executor` |
A capability registered with `ArtifactType::Native` and resolved through the placement router executes correctly via pool |
| `router_concurrent_requests_to_same_capability` |
8 concurrent `execute_capability()` calls through the router — all return correct results, no deadlock |
| `router_concurrent_requests_to_different_capabilities` |
4 concurrent calls to 4 distinct capabilities — each receives its own correct output |
Trace correctness
| Test name |
What it proves |
| `concurrent_executions_produce_isolated_traces` |
4 concurrent executions produce 4 distinct trace entries — no cross-contamination in `TraceStore` |
| `trace_capability_id_matches_executed_capability` |
Trace entry `capability_id` matches the dispatched capability for each concurrent call |
| `failed_execution_recorded_in_trace` |
A capability that returns `ExecutorError` produces a trace entry with failure status |
Event broker integration
| Test name |
What it proves |
| `event_published_by_pool_thread_reaches_broker` |
A capability executing on a pool thread can publish an event; the broker records it |
| `concurrent_event_publishers_no_broker_corruption` |
4 capabilities each publishing 3 events concurrently — broker contains all 12, no duplicates, no data races |
Workflow traversal
| Test name |
What it proves |
| `workflow_with_thread_pool_executor_completes_all_steps` |
A 3-step workflow using `ThreadPoolExecutor` for native capabilities completes with correct final output |
| `workflow_step_failure_halts_traversal` |
A workflow step returning error halts traversal at that step — subsequent steps not executed |
WASM path unchanged
| Test name |
What it proves |
| `wasm_capability_bypasses_thread_pool` |
A WASM capability registered alongside native capabilities executes via `WasmExecutor` — `ThreadPoolExecutor` is not invoked for it |
Definition of Done
Summary
Write integration tests that wire `ThreadPoolExecutor` through the full `TraverseRuntime` stack — registry, router, placement, trace — and verify end-to-end correctness under concurrent load. These tests live in `crates/traverse-runtime/tests/thread_pool_integration.rs`.
Governing Spec
Blocked by
Test inventory
Drop-in replacement
Router integration
Trace correctness
Event broker integration
Workflow traversal
WASM path unchanged
Definition of Done