ECONNRESET error


#1

Sometimes when running adonis test I get error below

events.js:193
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at _errnoException (util.js:1031:13)
    at TCP.onread (net.js:619:25)

Any idea of how to fix this?


Browser testing with AdonisJs
#2

Hi, try to downgrade ws with this command

npm i -D -E ws@3.3.2 # Fix Test Error

#3

Hey @Tsume! :wave:

Could you please give us some code so we can take a look? :smiley:


#4

Sorry for late response,

It seems random when this occurs. I have browser tests (about 25) and it randomly pops this error and stops the tests.

Out of 10 adonis test 3 returned this error. Tests are not changed between the tests.

To check if whether was a problem with my code I used this example:

It actually takes a lot of adonis test to produce the issue.

... 
...
  Update Post
    ✓ fields are filled when editing a post (551ms)
    ✖ we can update a post (601ms)
events.js:193
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at _errnoException (util.js:1031:13)
    at TCP.onread (net.js:619:25)

And another one…

adonis test
2018-02-27T21:10:20.212Z - info: serving app on http://127.0.0.1:4000
migrate: 1503248427885_user.js
migrate: 1507839709797_post_schema.js
Database migrated successfully in 160 ms

  Authentication
    ✓ should display an error when crendentials are incorect (352ms)
    ✓ a user can log in inside the application (381ms)

  Delete Post
    ✓ we can delete a post (453ms)
events.js:193
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at _errnoException (util.js:1031:13)
    at TCP.onread (net.js:619:25)



#5

I have this issue too, it happens so randomly.


#6

sorry for responding late.

Issue happens when tests hangs or takes too long .5 - 1+ second to execute the test.

I downgraded and apparently it works. Got no issue so far… I hope this is it! :smiley:
thanks!