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

SSL error code 1, net_error -100 - The tests intermittently fail with SIGSEGV event #24778

Closed
ps37 opened this issue Nov 22, 2022 · 3 comments
Closed
Assignees
Labels
CI General issues involving running in a CI provider

Comments

@ps37
Copy link

ps37 commented Nov 22, 2022

Current behavior

We recently upgraded our cypress from 8.7.0 to 10.11.0 and started seeing the following error in our Jenkins build pipelines. Some of the tests are intermittently failing in the very beginning in the Mocha before hook with:

Running:  operator/operator-organizations.feature.cy.ts                                   (7 of 8)
[105736:1121/143716.572886:ERROR:ssl_client_socket_impl.cc(983)] handshake failed; returned -1, SSL error code 1, net_error -100
[105736:1121/143716.573223:ERROR:ssl_client_socket_impl.cc(983)] handshake failed; returned -1, SSL error code 1, net_error -100
[105736:1121/143716.573400:ERROR:ssl_client_socket_impl.cc(983)] handshake failed; returned -1, SSL error code 1, net_error -100
The Test Runner unexpectedly exited via an exit event with signal SIGSEGV

However, this was not the case previously on the 8.7.0 version.

Desired behavior

The tests should not fail intermittently and continue the execution like how they were in version 8.7.0

Test code to reproduce

Before each test, we navigate to a URL(cy.navigateTo("/operator")) as shown below:

describe("Should show organizations", () => {
    let organizationsPageWo: OrganizationsPageWidgetObject<Cypress.Chainable>;

    before(() => {
      cy.intercept(new RegExp("https://.*/orgStats?.*")).as("fetchOrgs");
      cy.navigateTo("/operator");
      cy.wait("@fetchOrgs", { timeout: 60000 });
    });

    beforeEach(() => {
      organizationsPageWo = find(OrganizationsPageWidgetObject) as OrganizationsPageWidgetObject<Cypress.Chainable>;
    });

    it("Should visit organizations page", () => {
      organizationsPageWo
        .getHeader({ options: { timeout: 3000 } })
        .unwrap()
        .should("exist");
    });
})

And inside the custom navigateTo command, we programmatically do SSO login as shown below:

/**
 * Authenticate with the org using the refresh token in an environment variable.
 */
export function getAuthToken(): Chainable {
  const accessTokenReqOptions = {
    method: "POST",
    url: isDevOrStagingEnv() ? AUTHORIZATION_URL : AUTHORIZATION_URL_PROD,
    qs: {
      refresh_token: isDevOrStagingEnv()
        ? `${ORG_REFRESH_TOKEN}`
        : `${ORG_REFRESH_TOKEN_PROD}`,
    },
    headers: AUTH_HEADERS,
  };
  return cy.request(accessTokenReqOptions);
}

/**
 * Visits the location after authenticating.
 */
export function navigateTo(location: string): Chainable {
  return getAuthToken().then((accessTokenRes) => {
    cy.visit(location, {
      onBeforeLoad: (contentWindow) => {
        contentWindow.sessionStorage.setItem(Cypress.env("authToken"), JSON.stringify(accessTokenRes.body));
      },
    });
  });
}

Cypress Version

10.11.0

Node version

14.21.0

Operating System

"os":"Linux", "arch":"x64"

Debug Logs

log.txt

Other

No response

@nagash77 nagash77 added CI: jenkins CI General issues involving running in a CI provider labels Nov 22, 2022
@nagash77 nagash77 assigned BlueWinds and unassigned mjhenkes Dec 6, 2022
@BlueWinds
Copy link
Contributor

I'm not sure this is the issue you're running into - it might be unrelated - but aliases are reset before each test.

Note: all aliases are reset before each test. A common user mistake is to create aliases using the before hook. Such aliases work in the first test only!

You might be well served with cy.session(), which is designed to help out with exactly the workflow you've implemented.

Again not sure either of these directly address the bug report, but they'd be things to try out at least.

@BlueWinds BlueWinds assigned chrisbreiding and unassigned BlueWinds Jan 11, 2023
@chrisbreiding
Copy link
Contributor

Going to close due to inactivity. Please post a comment if this is still an issue and we can re-open it.

@arbrsts
Copy link

arbrsts commented May 10, 2024

We are encountering the same issue when running cypress in our CI pipeline


  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        3                                                                                │
  │ Passing:      3                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        false                                                                            │
  │ Duration:     0 seconds                                                                        │
  │ Spec Ran:     navigation/tab/HorizontalTab.cy.tsx                                              │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
[2013:0510/082333.936818:ERROR:ssl_client_socket_impl.cc(978)] handshake failed; returned -1, SSL error code 1, net_error -101
[2013:0510/082333.952534:ERROR:ssl_client_socket_impl.cc(978)] handshake failed; returned -1, SSL error code 1, net_error -101

Below are the podman commands used to create the runner environment from docker:io/node:18 base image

  podman run -d -i --rm -v ./:/app:Z --name ${RUNNER_ID}_node --pod ${RUNNER_ID} docker.io/node:18 sh
  podman exec -w /app ${RUNNER_ID}_node sh -c "apt update && apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb"
  podman exec -w /app ${RUNNER_ID}_node npm ci
  podman exec -w /app ${RUNNER_ID}_node npm run test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI General issues involving running in a CI provider
Projects
None yet
Development

No branches or pull requests

7 participants