Skip to content
This repository has been archived by the owner on Feb 7, 2022. It is now read-only.

Unable to convert JMeter file to K6, getting error (node:8216) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated #34

Closed
Malaw80s opened this issue Jul 28, 2020 · 2 comments

Comments

@Malaw80s
Copy link

I'm trying to convert the file attached, but I'm getting the error below:

C:\jmeter>jmeter-to-k6 TestOPSWAT.jmx -o full
(node:8216) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '1' of null
at func (C:\Users\malaw\AppData\Roaming\npm\node_modules\jmeter-to-k6\src\string\render.js:25:42)
at evaluate (C:\Users\malaw\AppData\Roaming\npm\node_modules\jmeter-to-k6\src\string\render.js:18:12)
at replace (C:\Users\malaw\AppData\Roaming\npm\node_modules\jmeter-to-k6\src\string\render.js:7:10)
at C:\Users\malaw\AppData\Roaming\npm\node_modules\jmeter-to-k6\src\string\render.js:52:40
at Array.map ()
at render (C:\Users\malaw\AppData\Roaming\npm\node_modules\jmeter-to-k6\src\string\render.js:52:25)
at runtimeString (C:\Users\malaw\AppData\Roaming\npm\node_modules\jmeter-to-k6\src\string\run.js:12:21)
at property (C:\Users\malaw\AppData\Roaming\npm\node_modules\jmeter-to-k6\src\element\HTTPSamplerProxy.js:208:24)
at Object.HTTPSamplerProxy (C:\Users\malaw\AppData\Roaming\npm\node_modules\jmeter-to-k6\src\element\HTTPSamplerProxy.js:27:5)
at element (C:\Users\malaw\AppData\Roaming\npm\node_modules\jmeter-to-k6\src\element.js:66:36)
(Use node --trace-warnings ... to show where the warning was created)
(node:8216) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8216) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

TestOPSWAT.zip

simskij added a commit that referenced this issue Aug 7, 2020
@simskij
Copy link
Contributor

simskij commented Aug 7, 2020

Hey,

Thank you for the report! Reproducing this error made me find two hard-spotted regex errors that have now been fixed. However, the reason that your conversion is failing is because you utilize __RANDOM, a Jmeter helper not supported by the converter.

The easiest way to get around this is by stripping your jmx of this call, and then substitute it with a call to randomIntBetween in the final output. randomIntBetween is directly require:able from https://jslib.k6.io/k6-utils/1.0.0/index.js

Thanks,
Simme

@Malaw80s
Copy link
Author

Malaw80s commented Aug 7, 2020

Thank you for getting back to me, I'll pass this to the performance team so they can make the required changes and let you know.
Thanks again for your help :)

@simskij simskij closed this as completed Jan 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants