alexfernandez / loadtest

Runs a load test on the selected URL. Fast and easy to use. Can be integrated in your own workflow using the API.
MIT License
2.57k stars 209 forks source link

TypeError: Cannot read property 'id' of undefined #234

Closed kk2491 closed 6 months ago

kk2491 commented 6 months ago

Hi,

First of all thanks for this wonderful tool. It really helps in testing the APIs quickly.

Ubuntu version : 22.04
Node version : v14.21.3

I have installed the loadtest gloabally. When I try to execute a query, I ran into the below error.

kishor@kishor-sys:~$ loadtest -n 10 -c 5 http://localhost:13000/endpoint1
file:///usr/lib/node_modules/loadtest/lib/cluster.js:20
        const result = await task(cluster.worker.id) || '0'
                                                 ^

TypeError: Cannot read property 'id' of undefined
    at runTask (file:///usr/lib/node_modules/loadtest/lib/cluster.js:20:44)
    at processAndRun (file:///usr/lib/node_modules/loadtest/bin/loadtest.js:60:24)
    at file:///usr/lib/node_modules/loadtest/bin/loadtest.js:111:7
    at <anonymous> (<anonymous>)
kishor@kishor-sys:~$ 

Is there anything I am missing here?

Thank you,
KK

kk2491 commented 6 months ago

Hi,

I got this fixed, kindly ignore the issue created.

I just noticed the compatibility matrix with respect to node version. Based on that I installed the 5.0.1 version, now it works like a charm.

Thanks for the wonderful tool.

Thank you,
KK

alexfernandez commented 6 months ago

Great, thanks for the update!