Test script variable extractors use unawaited async IIFEs, causing race conditions in scenario execution
Artur L
When a request has variable extractors configured (e.g. extract
$.id
→ global variable), Apidog generates the following pattern in the test script:```js
;(async () => {
const value = JSONPath({ json: pm.response.json(), path: expression, wrap: false });
pm.globals.set(formattedName, value);
})();
```
This async IIFE is invoked without
await
, making it fire-and-forget. The runtime does not wait for the promise to resolve before advancing to the next request in the scenario.As a result, global variables are not yet set when the next request executes, causing it to run with
undefined
or stale values. This breaks any multi-step scenario where each step depends on variables extracted from the previous response.Additional Context:
- The issue affects all auto-generated extractors across an entire scenario - every single extractor block has this pattern.
- Global timeout settings have no effect on this issue
franki
Hello, thank you for providing detailed information. We have not yet reproduced this issue.
Would you be able to provide the following information?
- Apidog Version Number
- Reproduce Endpoint
- Screenshot or screen recording