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 #20

Closed
wants to merge 1 commit into from

Commits on Feb 6, 2024

  1. test(cactus-core): fix false negative test results

    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 committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    3959cae View commit details
    Browse the repository at this point in the history