ssh2-streams icon indicating copy to clipboard operation
ssh2-streams copied to clipboard

SIGNREQUEST output in Jest

Open lvl99 opened this issue 3 years ago • 5 comments

I'm using sftp-promises which uses this library as a dependency, and I'm finding that Google Cloud Build (GCB) is breaking when it is trying to run tests via Jest:

Step #2: Jest has detected the following 2 open handles potentially keeping Jest from exiting:
Step #2: 
Step #2:   ●  SIGNREQUEST
Step #2: 
Step #2:     > 1 | const SFTPClient = require("sftp-promises");
Step #2:         | ^
Step #2: 
Step #2:       at node_modules/ssh2-streams/lib/constants.js:15:20
Step #2:       at Object.<anonymous> (node_modules/ssh2-streams/lib/constants.js:22:3)
Step #2:       at Object.<anonymous> (node_modules/ssh2-streams/lib/keyParser.js:23:17)
Step #2:       at Object.<anonymous> (node_modules/ssh2-streams/lib/utils.js:14:13)
Step #2:       at Object.<anonymous> (node_modules/ssh2-streams/lib/sftp.js:13:18)
Step #2:       at Object.<anonymous> (node_modules/ssh2-streams/index.js:2:15)
Step #2:       at Object.<anonymous> (node_modules/ssh2/lib/client.js:8:20)
Step #2:       at Object.<anonymous> (node_modules/sftp-promises/index.js:1:96)
Step #2:       at Object.<anonymous> (src/utils/sftp.js:1:1)

When I look at line 15, I can see that there's some attempt to validate a crypto algo, potentially to test to see if the local environment supports it. I'm unsure why it breaks on GCB (using node:latest), but it's been a hair-pulling experience trying to debug.

Has anyone else come across this issue?

lvl99 avatar Sep 27 '21 14:09 lvl99

Since that library is not using ssh2-streams directly, I would suggest having the sftp-promises maintainer upgrade their dependency on ssh2 first and if the issue persists, lodge an issue on the ssh2 repo instead.

mscdex avatar Sep 27 '21 14:09 mscdex

I just refactored to use ssh2-sftp-client and I'm getting the same issue due another issue with ssh2. Thanks for pointing that out.

lvl99 avatar Sep 28 '21 08:09 lvl99

@lvl99 Running into the same issue here. Did you figure it out?

ArnoSoontjens avatar Jan 26 '22 13:01 ArnoSoontjens

@ArnoSoontjens can't remember how I solved this, sorry -- my GCB project is still broken, but for another reason!

I may have tried to refactor so that I didn't import any internal module that uses the SFTP dependency in my tests. Otherwise, the last thing I remember updating was changing internal SFTP module to use bottleneck to prevent too many concurrent sessions being open.

I also have a vague feeling SIGNREQUEST might be a package or something that needs explicit consent to do something? Wish I could remember!

lvl99 avatar Jan 26 '22 22:01 lvl99

Also seeing the same issue, Jest failing to exit due to open handle at ssh2 constants: https://github.com/testcontainers/testcontainers-node/issues/346

cristianrgreco avatar Apr 11 '22 08:04 cristianrgreco