artilleryio / artillery

The complete load testing platform. Everything you need for production-grade load tests. Serverless & distributed. Load test with Playwright. Load test HTTP APIs, GraphQL, WebSocket, and more. Use any Node.js module.
https://www.artillery.io
Mozilla Public License 2.0
8.04k stars 511 forks source link

Artillery playwright config does not allow 0 timeout #2785

Closed HugoImaios closed 5 months ago

HugoImaios commented 5 months ago

When setting a 0 value for defaultNavigationTimeout, defaultPageTimeout or defaultTimeout, artillery fallback on 30s.

Version info:

v2.0.12

Using this config:

            defaultNavigationTimeout: 0
            defaultTimeout: 0

I expected to see this happen:

having a 0 timeout (no timeout)

Instead, this happened:

30s timeout is used

HugoImaios commented 5 months ago

it comes from https://github.com/artilleryio/artillery/blob/c8adbb73a431431430a96203b8dac432526390cc/packages/artillery-engine-playwright/index.js#L17 and https://github.com/artilleryio/artillery/blob/c8adbb73a431431430a96203b8dac432526390cc/packages/artillery-engine-playwright/index.js#L22

0 is falsy so || will return the right operand, the default 30

hassy commented 5 months ago

falsy values strike again! mind sending a quick PR? :)

HugoImaios commented 5 months ago

Yup ! I did the fork, I'll open one on monday, I need 0 timeout lol do you prefere a one-liner style or a cleaner const one ? lets discuss this in the PR, sorry