An unnamed async start, then unnamed status polls naming the same * repo_path: one while the held worker runs, one after it drained. */
| 6747 | /* An unnamed async start, then unnamed status polls naming the same |
| 6748 | * repo_path: one while the held worker runs, one after it drained. */ |
| 6749 | static void app_owner_run(app_owner_fixture_t *owner, app_owner_run_t *run) { |
| 6750 | memset(run, 0, sizeof(*run)); |
| 6751 | app_async_fixture_t *fixture = &owner->fixture; |
| 6752 | run->started = app_async_call_now(fixture, owner->session, ",\"async\":true"); |
| 6753 | run->worker_running = run->started && !app_async_contains(run->started, "\"isError\":true") && |
| 6754 | app_wait_for_atomic_int(&fixture->fake.starts, 1); |
| 6755 | run->running = app_async_call_now(fixture, owner->session, ",\"status\":true"); |
| 6756 | atomic_store(&fixture->fake.allow_completion, true); |
| 6757 | run->drained = run->worker_running && app_wait_for_active_jobs(fixture->application, 0); |
| 6758 | run->finished = |
| 6759 | run->drained ? app_async_call_now(fixture, owner->session, ",\"status\":true") : NULL; |
| 6760 | } |
| 6761 | |
| 6762 | static void app_owner_run_free(app_owner_run_t *run) { |
| 6763 | free(run->started); |
no test coverage detected