(client: LightningStoreClient)
| 121 | |
| 122 | |
| 123 | async def _run_client_side_operations(client: LightningStoreClient) -> None: |
| 124 | await client.update_resources("metrics-client", {}) |
| 125 | await client.get_latest_resources() |
| 126 | |
| 127 | await client.start_rollout(input={"origin": "client"}, mode="train", config=RolloutConfig(timeout_seconds=2.0)) |
| 128 | queued = await client.enqueue_rollout( |
| 129 | input={"origin": "client-queue"}, config=RolloutConfig(unresponsive_seconds=5.0) |
| 130 | ) |
| 131 | dequeued = await client.dequeue_rollout(worker_id="metrics-client-worker") |
| 132 | assert dequeued is not None |
| 133 | |
| 134 | span = _make_span(dequeued.rollout_id, dequeued.attempt.attempt_id, 1, "client-span") |
| 135 | await client.add_span(span) |
| 136 | |
| 137 | await client.update_attempt( |
| 138 | dequeued.rollout_id, |
| 139 | dequeued.attempt.attempt_id, |
| 140 | status="running", |
| 141 | worker_id="metrics-client-worker", |
| 142 | ) |
| 143 | await client.update_attempt(dequeued.rollout_id, dequeued.attempt.attempt_id, status="succeeded") |
| 144 | await client.update_rollout(dequeued.rollout_id, status="succeeded") |
| 145 | |
| 146 | await client.wait_for_rollouts(rollout_ids=[dequeued.rollout_id], timeout=0.1) |
| 147 | await client.query_rollouts() |
| 148 | await client.query_attempts(dequeued.rollout_id) |
| 149 | await client.get_worker_by_id("metrics-client-worker") |
| 150 | assert queued.rollout_id == dequeued.rollout_id |
| 151 | |
| 152 | |
| 153 | @pytest.mark.asyncio |
no test coverage detected