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

sequential/test-tls-psk-client fails on IBM i #44821

Open
richardlau opened this issue Sep 29, 2022 · 8 comments
Open

sequential/test-tls-psk-client fails on IBM i #44821

richardlau opened this issue Sep 29, 2022 · 8 comments
Labels
ibm i Issues and PRs related to the IBM i platform.

Comments

@richardlau
Copy link
Member

richardlau commented Sep 29, 2022

With #44215 we're down to one test that is failing the IBM i CI build:

https://ci.nodejs.org/job/node-test-commit-ibmi/862/nodes=ibmi73-ppc64/console

10:21:56 not ok 3714 sequential/test-tls-psk-client # TODO : Fix flaky test
10:26:56   ---
10:26:56   duration_ms: 300.226
10:26:56   severity: fail
10:26:56   exitcode: -15
10:26:56   stack: |-
10:26:56     timeout
10:26:56     Failed: Timed out
10:26:56   ...

This test is already marked flaky on IBM i

# https://github.com/nodejs/node/issues/39683
test-tls-psk-client: PASS, FLAKY
but it looks like the test runner treats timed out tests as failures (severity: fail) instead of flakes (severity: flaky).

Originally posted by @richardlau in #43509 (comment)

@richardlau richardlau mentioned this issue Sep 29, 2022
4 tasks
@richardlau richardlau added the ibm i Issues and PRs related to the IBM i platform. label Sep 29, 2022
@richardlau
Copy link
Member Author

richardlau commented Sep 29, 2022

Turns out that this test is failing because the spawn of the CLI openssl tool fails, although that isn't caught/reported:

const server = spawn(common.opensslCli, [
's_server',
'-accept', common.PORT,
'-cipher', CIPHERS,
'-psk', KEY,
'-psk_hint', IDENTITY,
'-nocert',
'-rev',
]);

If I manually run the openssl-cli command that is being spawned I get this:

Using default temp DH parameters
00000001:error:8000002A:system library:BIO_listen:Protocol driver not attached:../deps/openssl/openssl/crypto/bio/bio_sock2.c:275:calling setsockopt()
00000001:error:10000088:BIO routines:BIO_listen:listen v6 only:../deps/openssl/openssl/crypto/bio/bio_sock2.c:277:
   0 items in the session cache
   0 client connects (SSL_connect())
   0 client renegotiates (SSL_connect())
   0 client connects that finished
   0 server accepts (SSL_accept())
   0 server renegotiates (SSL_accept())
   0 server accepts that finished
   0 session cache hits
   0 session cache misses
   0 session cache timeouts
   0 callback cache hits
   0 cache full overflows (128 allowed)

However using the system OpenSSL CLI gives:

Using default temp DH parameters
ACCEPT

Which leads to:

  1. Do we expect the built openssl-cli to work on IBM i? Possibly not going by previous comments, e.g. test: skip some binding tests on IBMi PASE  #31967 (comment) which state that the IBM i port of Node.js always uses shared libs. Our CI job currently does not use shared libs which is a potential mismatch.
  2. The test should ideally detect if the openssl server hasn't started and error appropriately. It appears that currently it never terminates in this state as waitForPort spins forever waiting for the server to come up until the test runner times the test out and kills it.

cc @nodejs/platform-ibmi

@V-for-Vasili
Copy link
Contributor

I know that in the node rpm we build with --shared-openssl, so we use the system install. Looks like we use built openssl in https://ci.nodejs.org/job/node-test-commit-ibmi/913/nodes=ibmi73-ppc64/consoleText.
Also, what version is the built openssl-cli? I think 1.1.1 is the latest we support but I need to double check

@richardlau
Copy link
Member Author

richardlau commented Sep 29, 2022

Also, what version is the built openssl-cli? I think 1.1.1 is the latest we support but I need to double check

@V-for-Vasili It would be OpenSSl 3.0.x, built from deps/openssl.
FWIW I've started a CI run with CONFIG_FLAGS='--shared-openssl --shared-openssl-includes=/QOpenSys/usr/include --shared-openssl-libpath=/QOpenSys/lib --dest-cpu=ppc64': https://ci.nodejs.org/job/node-test-commit-ibmi/915/

@V-for-Vasili
Copy link
Contributor

Yep, we don't support 3.x on Ibmi, and we use 1.1.1 with the node rpm. 3.x is work in progress currently.

@richardlau
Copy link
Member Author

FWIW I've started a CI run with CONFIG_FLAGS='--shared-openssl --shared-openssl-includes=/QOpenSys/usr/include --shared-openssl-libpath=/QOpenSys/lib --dest-cpu=ppc64': https://ci.nodejs.org/job/node-test-commit-ibmi/915/

Looks like that failed while linking 😞 .

nodejs-github-bot pushed a commit that referenced this issue Oct 2, 2022
Add assertions to sequential/test-tls-psk-client to check if the
spawned OpenSSL server has exited in any way except for the expected
termination by the cleanUp() function. The added assertions will
prevent the test from spinning forever trying to connect to the
non-existent server in the case that the spawned process has exited.
Include stderr and stdout in the assertion failure message to aid
debugging.

PR-URL: #44824
Refs: #44821
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@richardlau richardlau changed the title sequential/test-tls-psk-client times out on IBM i sequential/test-tls-psk-client fails on IBM i Oct 6, 2022
@richardlau
Copy link
Member Author

Further digging on test-iinthecloud-ibmi73-ppc64_be-1 showed that the system openssl command in /QOpenSys/bin/ was 1.0.2q. Installing openssl via yum installs OpenSSL 1.1.1n into /QOpenSys/pkgs/bin/ and that has the same "Protocol driver not attached" error.

Turns out we've seen this before: #42152 (comment)

@richardlau
Copy link
Member Author

(FWIW after #44824 the test no longer times out but fails with the "Protocol driver not attached" error from the call to the openssl CLI (either system when compiled with --shared-openssl or the one built from deps/openssl.)

danielleadams pushed a commit that referenced this issue Oct 11, 2022
Add assertions to sequential/test-tls-psk-client to check if the
spawned OpenSSL server has exited in any way except for the expected
termination by the cleanUp() function. The added assertions will
prevent the test from spinning forever trying to connect to the
non-existent server in the case that the spawned process has exited.
Include stderr and stdout in the assertion failure message to aid
debugging.

PR-URL: #44824
Refs: #44821
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@abmusse
Copy link
Contributor

abmusse commented Mar 8, 2023

#42152 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ibm i Issues and PRs related to the IBM i platform.
Projects
None yet
Development

No branches or pull requests

3 participants