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

test(cactus-core): fix false negative test results #3013

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

petermetz
Copy link
Contributor

The fix was to start statically importing the http helper library we use
in packages/cactus-core/src/main/typescript/web-services/handle-rest-endpoint-exception.ts
instead of how it was (dynamic imports at runtime).

  1. There have been reports of dynamic imports causing segmentation
    faults in the NodeJS process when Jest is involved.
  2. It is looking like this bug was another instance of that manifesting
    but slightly differently because this time around Jest decided to hide
    the stack trace of it as well.
  3. Because of 2) we have no specific evidence of the theory. We can only
    say that the change in this commit made the problem go away, but since
    there never was any crash logs or stack traces on the CI environment,
    this remains a conjecture.
  4. Trying to reproduce the issue locally failed even when using the
    exact same versions of NodeJS and npm (and all the dependencies of course).
  5. Based on 4) it is likely that the segmentation fault is due to a
    race condition in the lower level (C/C++) code of NodeJS and/or Jest.

Fixes #2966

Signed-off-by: Peter Somogyvari peter.somogyvari@accenture.com

Pull Request Requirements

  • Rebased onto upstream/main branch and squashed into single commit to help maintainers review it more efficient and to avoid spaghetti git commit graphs that obfuscate which commit did exactly what change, when and, why.
  • Have git sign off at the end of commit message to avoid being marked red. You can add -s flag when using git commit command. You may refer to this link for more information.
  • Follow the Commit Linting specification. You may refer to this link for more information.

Character Limit

  • Pull Request Title and Commit Subject must not exceed 72 characters (including spaces and special characters).
  • Commit Message per line must not exceed 80 characters (including spaces and special characters).

A Must Read for Beginners
For rebasing and squashing, here's a must read guide for beginners.

Copy link
Contributor

@jagpreetsinghsasan jagpreetsinghsasan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The fix was to start statically importing the http helper library we use
in `packages/cactus-core/src/main/typescript/web-services/handle-rest-endpoint-exception.ts`
instead of how it was (dynamic imports at runtime).

1. There have been reports of dynamic imports causing segmentation
faults in the NodeJS process when Jest is involved.
2. It is looking like this bug was another instance of that manifesting
but slightly differently because this time around Jest decided to hide
the stack trace of it as well.
3. Because of `2)` we have no specific evidence of the theory. We can only
say that the change in this commit made the problem go away, but since
there never was any crash logs or stack traces on the CI environment,
this remains a conjecture.
4. Trying to reproduce the issue locally failed even when using the
exact same versions of NodeJS and npm (and all the dependencies of course).
5. Based on `4)` it is likely that the segmentation fault is due to a
race condition in the lower level (C/C++) code of NodeJS and/or Jest.

Fixes hyperledger-cacti#2966

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
@petermetz petermetz merged commit c71568c into hyperledger-cacti:main Feb 7, 2024
130 of 146 checks passed
@petermetz petermetz deleted the petermetz/issue2966 branch February 7, 2024 16:26
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

Successfully merging this pull request may close these issues.

test(ci): require some core tests
3 participants