Loading
Add REST API for parallel test balancing
What does this MR do and why?
This MR adds the REST API layer for parallel test balancing, building on the Redis-backed queue introduced in the parent MR. It exposes two endpoints under /job/test_balancing that let a running parallel CI/CD job claim duration-budgeted batches of test splits from a job group's shared pending pool, so work is balanced across nodes.
API summary
| Endpoint | Method | Description |
|---|---|---|
/job/test_balancing/initialize |
POST |
Seeds the job group's shared pending pool with the caller's static test split, then claims a first batch. On a job retry or crash recovery, returns the node's previously claimed set unchanged. |
/job/test_balancing/request |
POST |
Atomically claims a duration-budgeted batch of pending test splits for the calling node, slowest first. An empty result means the queue is drained. |
The new paths the pattern of /job/allowed_agents which is also an endpoint authenticated by a CI job token and fetches information related to the current job.
Feature availability
- Gated behind the
parallel_test_balancingfeature flag (beta, disabled by default). - Requires the
ci_parallel_test_balancinglicensed feature (Ultimate). - Endpoints are currently hidden and marked as experiment.
Related to #607450 (closed)
Edited by Heinrich Lee Yu