-
Notifications
You must be signed in to change notification settings - Fork 546
Description
Description
When running distributed load tests via artillery run-aci, Artillery Cloud dashboard consistently shows 0 workers during and after test execution. All other metrics (response times, status codes, VU counts, per-endpoint breakdowns) are reported correctly. Only the worker count metadata is missing.
Artillery Version: 2.0.29 (latest)
Steps to Reproduce
- Configure Azure ACI with service principal + storage account
- Run:
npx artillery run-aci \ --count 5 \ --region uaenorth \ --record \ --key "$ARTILLERY_CLOUD_API_KEY" \ tests/my-test.yml - Open the Run URL in Artillery Cloud dashboard
Expected: Dashboard shows 5 workers
Actual: Dashboard shows 0 workers (metrics are correctly aggregated)
Evidence
Three test runs all show 0 workers despite successful completion:
| Test | --count | VUs Completed | Workers Shown |
|---|---|---|---|
| Health Check | 1 | 20 | 0 |
| Broker API | 5 | 16,950 | 0 |
| Identity API | 3 | 5,130 | 0 |
Root Cause Analysis
Investigation of the source code identified two issues:
1. WORKER_ID env var mismatch (lib/platform/az/aci.js + lib/platform/cloud/cloud.js)
The ACI platform sets WORKER_ID_OVERRIDE on containers, but the Cloud plugin checks for WORKER_ID:
// aci.js - sets WORKER_ID_OVERRIDE
{ name: 'WORKER_ID_OVERRIDE', value: workerId }
// cloud.js - checks WORKER_ID
const enabledInCloudWorker =
typeof process.env.WORKER_ID !== 'undefined' &&
typeof process.env.ARTILLERY_CLOUD_API_KEY !== 'undefined';The bash wrapper script (loadgen-worker) converts WORKER_ID_OVERRIDE to WORKER_ID, but this happens after Node.js has already evaluated process.env.WORKER_ID as undefined. Workers never register with Artillery Cloud.
2. Missing worker count in ACI metadata (lib/platform/az/aci.js)
The ACI platform emits metadata without the count field:
// aci.js (lines 355-362) - no count field
const metadata = { region: this.region, platformConfig: { memory, cpu } };While run.js correctly includes it:
// run.js - includes count
metadata: { count: runnerOpts.count || Number(flags.count), ... }Suggested Fix
Fix 1: Add WORKER_ID alongside WORKER_ID_OVERRIDE in container env vars:
{ name: 'WORKER_ID', value: workerId }Fix 2: Include count in ACI metadata:
const metadata = { region: this.region, count: this.count, platformConfig: { memory, cpu } };Environment
- Node.js: v25.3.0
- OS: Linux (Ubuntu)
- Azure Region: UAE North
- ACI containers provisioned successfully, metrics aggregation works correctly
Related Issues
- Artillery test on Azure ACI failed to conclude #3355 - Artillery test on Azure ACI failed to conclude (related ACI issue)
- ARTILLERY_CLOUD_API_KEY has no effect in .env file #2582 - ARTILLERY_CLOUD_API_KEY has no effect in .env file (related credential handling)