Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm test fail #2

Open
kavinchauhan opened this issue Apr 16, 2021 · 4 comments
Open

npm test fail #2

kavinchauhan opened this issue Apr 16, 2021 · 4 comments

Comments

@kavinchauhan
Copy link

I have installed your siprec-server with rtpengine and now want to test it using siprec-client.

I have installed drachtio-siprec-client for the same but I am not getting success if I test it using "npm test". I try to figure it out but not get any success. There are no call on sipp with uas and uac when test run.

I have share you full logs for fs_cli, drachtio docker and console log when run test.

Console Log: https://pastebin.freeswitch.org/view/fdf8cf94
Drachtio Docker Log: https://pastebin.freeswitch.org/view/47b15426
Freeswitch Log: https://pastebin.freeswitch.org/view/05d31702

@davehorton
Copy link
Owner

please update to the latest and retry

@kavinchauhan
Copy link
Author

kavinchauhan commented Apr 16, 2021

Still it's failing with below error. And your new build is failing in Travis ci also.


[root@ip-172-31-23-246 drachtio-siprec-recording-client]# npm test

[email protected] test /usr/src/drachtio-siprec-recording-client
NODE_ENV=test node test/ | ./node_modules/.bin/tap-spec

starting docker network for sip tests..

siprec invite test

/usr/src/drachtio-siprec-recording-client/app.js:21
localHostPorts.push({host: arr[2], port: arr[3]});
^

TypeError: Cannot read property '2' of null
at /usr/src/drachtio-siprec-recording-client/app.js:21:39
at Array.map ()
at Srf. (/usr/src/drachtio-siprec-recording-client/app.js:19:27)
at Srf.emit (events.js:327:22)
at Immediate. (/usr/src/drachtio-siprec-recording-client/node_modules/drachtio-srf/lib/srf.js:91:64)
at processImmediate (internal/timers.js:461:21)

npm ERR! Test failed. See above for more details.

@kavinchauhan
Copy link
Author

kavinchauhan commented Apr 17, 2021

@davehorton
I am getting this value for hostport: udp/[::1]:5060,udp/172.33.0.2:5060,udp/127.0.0.1:5060
and in hp I get udp/[::1]:5060 so not able to get array with host and port.
I changed app.js code with below code to resolve above error.


if (config.has('drachtio.host')) {
  srf.connect(config.get('drachtio'));
  srf
    .on('connect', (err, hostport) => {
        const hp = hostport.split(",");
        const arr = /([a-z]+)\/([0-9\.]+):(\d+)/.exec(hp[1]);
        localHostPorts.push({host: arr[2], port: arr[3]});
      logger.info(`successfully connected to drachtio listening on ${JSON.stringify(localHostPorts)}`);
    })

@kavinchauhan
Copy link
Author

Now call work but it's take too much time due to one test showing fail.
I think start_docker is failing some where.
Here my log:

[root@ip-172-31-23-246 drachtio-siprec-recording-client]# npm test

> [email protected] test /usr/src/drachtio-siprec-recording-client
> NODE_ENV=test node test/ | ./node_modules/.bin/tap-spec


  starting docker network for sip tests..

    stdout: 
Creating freeswitch ... done
Creating drachtio ... done
    Creating sipp_siprec_server ... 
    Creating freeswitch ... 
Creating drachtio ... 
    
    freeswitch freeswitch is ready
    ✔ docker is up

    ✖ test timed out after 180000ms
    --------------------------------
      operator: fail
      stack: |-
  Error: test timed out after 180000ms
  at Test.assert [as _assert] (/usr/src/drachtio-siprec-recording-client/node_modules/tape/lib/test.js:224:54)
  at Test.bound [as _assert] (/usr/src/drachtio-siprec-recording-client/node_modules/tape/lib/test.js:76:32)
  at Test.fail (/usr/src/drachtio-siprec-recording-client/node_modules/tape/lib/test.js:317:10)
  at Test.bound [as fail] (/usr/src/drachtio-siprec-recording-client/node_modules/tape/lib/test.js:76:32)
  at Timeout._onTimeout (/usr/src/drachtio-siprec-recording-client/node_modules/tape/lib/test.js:138:14)
  at listOnTimeout (internal/timers.js:554:17)
  at processTimers (internal/timers.js:497:7)


  siprec invite test

    {"level":30,"time":1618646624528,"msg":"successfully connected to drachtio listening on [{\"host\":\"172.33.0.2\",\"port\":\"5060\"}]","pid":27728,"hostname":"ip-172-31-23-246.ca-central-1.compute.internal","v":1}
    cmd: docker run -t --rm --net test_siprec -v /usr/src/drachtio-siprec-recording-client/test/scenarios:/tmp drachtio/sipp sipp -m 1 -sf /tmp/uac_siprec_pcap.xml drachtio
    {"level":30,"time":1618646625731,"msg":"received INVITE from 172.33.0.6: uri: sip:[email protected]  {\"family\":\"ipv4\",\"scheme\":\"sip\",\"user\":\"service\",\"host\":\"172.33.0.4\",\"port\":null,\"params\":{},\"headers\":{}}","pid":27728,"hostname":"ip-172-31-23-246.ca-central-1.compute.internal","callid":"[email protected]","v":1}
    {"level":30,"time":1618646626523,"msg":"created conference: anon-7a4e6754-f029-48ca-871a-ba8917f63780","pid":27728,"hostname":"ip-172-31-23-246.ca-central-1.compute.internal","callid":"[email protected]","v":1}
.. .. ..
.. .. ..
.. .. ..

    {"level":30,"time":1618646635141,"msg":"ending call","pid":27728,"hostname":"ip-172-31-23-246.ca-central-1.compute.internal","callid":"[email protected]","v":1}
    ✔ sip test passed

  stopping docker network..

Stopping drachtio           ... done
Stopping sipp_siprec_server ... done
Stopping sipp_uas           ... done
Stopping freeswitch         ... done
Removing drachtio           ... done
Removing sipp_siprec_server ... done
Removing sipp_uas           ... done
Removing freeswitch         ... done
Removing network test_siprec



  Failed Tests: There was 1 failure

    starting docker network for sip tests..

      ✖ test timed out after 180000ms


  total:     3
  passing:   2
  failing:   1
  duration:  3m 16.3s


npm ERR! Test failed.  See above for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants