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

Fix flaky Cypress CI tests #1392

Closed
metasoarous opened this issue Apr 19, 2022 · 9 comments
Closed

Fix flaky Cypress CI tests #1392

metasoarous opened this issue Apr 19, 2022 · 9 comments
Assignees
Labels
👋🏽 community ⚒️ infrastructure Re: automation, continuous integration. 👷🏻‍♀️ testing e2e, unit, or other test work
Milestone

Comments

@metasoarous
Copy link
Member

metasoarous commented Apr 19, 2022

Our Cypress CI tests have been getting increasingly flaky of late:

#1341 (comment)
#1354 (comment)

They seem to sporadically pass, then fail in a random manner, making useless (or worse).

@metasoarous
Copy link
Member Author

FWIW, now the tests aren't even running at all because of a npm ci issue that I haven't been able to sort out.

https://github.com/compdemocracy/polis/runs/6072601477?check_suite_focus=true#step:10:32

@metasoarous metasoarous mentioned this issue Apr 19, 2022
4 tasks
@metasoarous
Copy link
Member Author

There are some notes on running the cypress tests locally here, which may be helpful:

https://github.com/compdemocracy/polis/wiki/Running-E2E-tests-locally

There's also some steps which might be taken to run the workflows manually on a GitHub fork, if that proves easier.

#1341 (comment)

@patcon
Copy link
Contributor

patcon commented Sep 6, 2022

What are the sporadic failures:

  1. emails.spec.js log proof.
    • log error:
      http://localhost:1080/email/all
      
      We attempted to make an http request to this URL but the request failed without a response.
      
      We received this error at the network level:
      
        > Error: connect ECONNREFUSED 127.0.0.1:1080
      
      -----------------------------------------------------------
      
      The request we sent was:
      
      Method: DELETE
      URL: http://localhost:1080/email/all
      
    • maybe helpful fix? https://stackoverflow.com/a/27601038/504018
  2. [others?]

@SebastianRuan
Copy link
Contributor

SebastianRuan commented Sep 7, 2022

I'm also getting emails.spec.js errors on github but the tests pass locally.
My logs:

Running:  polis/emails.spec.js                                                          (14 of 14)
  Emails

RangeError: Maximum call stack size exceeded

    at _deconstructPacket (/home/runner/.cache/Cypress/6.8.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:21:28)

    at _deconstructPacket (/home/runner/.cache/Cypress/6.8.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)

    at _deconstructPacket (/home/runner/.cache/Cypress/6.8.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)

I'm not sure why it is a different error than what @patcon was getting.

@patcon
Copy link
Contributor

patcon commented Sep 7, 2022

ooo that's a fun one. seems pretty general, but i don't recall seeing it elsewhere. If you have a sec, there should be a button to "re-run" on the logs page, and I'd be curious to know if it shows up again 🤔

@patcon
Copy link
Contributor

patcon commented Sep 12, 2022

Potential fix over here: #1521

@crkrenn
Copy link
Contributor

crkrenn commented Dec 6, 2022

@patcon, @metasoarous, @ballPointPenguin,

Hi all, I've recently retired and am planning to work on polis a lot more.

I am having my own problems with cypress in that I can't even run npm install in the e2e directory successfully.

m ERR! > [email protected] build
npm ERR! > rm -rf dist && tsc --project ./tsconfig-build.json
npm ERR! 
npm ERR! node_modules/@types/express-serve-static-core/index.d.ts(99,68): error TS1110: Type expected.

I've tried using both the edge and stable branches on OSX and amazon linux. I found a post suggesting to use a more recent version of Cypress, but the simple hack of updating to Cypress version 9.7.0 did not work.

Do you all have suggestions or a workaround for this? I'm guessing that it is a node and/or typescript version incompatibility.

ec2-user:~/environment/polis/e2e (stable) $ tsc --version
Version 3.7.5
ec2-user:~/environment/polis/e2e (stable) $ node --version
v16.18.1

If not, I can work on it more systematically.

Thanks!

-Chris

@patcon
Copy link
Contributor

patcon commented Dec 7, 2022

@crkrenn congrats on the retirement! 😊

@metasoarous metasoarous added this to the Stable milestone Feb 1, 2023
@ballPointPenguin ballPointPenguin added the 👷🏻‍♀️ testing e2e, unit, or other test work label Feb 9, 2023
@ballPointPenguin ballPointPenguin self-assigned this Feb 16, 2023
@xeeg
Copy link
Contributor

xeeg commented Apr 6, 2023

Fixed here 18a0e48

@xeeg xeeg closed this as completed Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👋🏽 community ⚒️ infrastructure Re: automation, continuous integration. 👷🏻‍♀️ testing e2e, unit, or other test work
Projects
None yet
Development

No branches or pull requests

7 participants