Skip to content

Conversation

@zzmp
Copy link
Contributor

@zzmp zzmp commented May 20, 2023

Description

Simplifies tests in an attempt to de-flake them.

  • Refactors some swap tests, and simplifies the rest.
  • Improves memory management of cypress with an experimental flag.
  • Records flakey runs (previously, only failed runs were recorded).

Test plan

Automated testing

  • Integration/E2E test

@zzmp zzmp requested review from a team, JFrankfurt and tinaszheng May 20, 2023 00:03
@vercel
Copy link

vercel bot commented May 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
interface ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2023 3:19am

@zzmp zzmp temporarily deployed to false May 20, 2023 00:03 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 00:03 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 00:03 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 00:03 — with GitHub Actions Inactive
@zzmp zzmp force-pushed the de-flake-a-thon branch from 8c76e32 to 602c58f Compare May 20, 2023 00:04
@zzmp zzmp temporarily deployed to false May 20, 2023 00:04 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 00:04 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 00:04 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 00:04 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented May 20, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.60 🎉

Comparison is base (8fe7c7a) 60.14% compared to head (8a2fe8f) 60.74%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6611      +/-   ##
==========================================
+ Coverage   60.14%   60.74%   +0.60%     
==========================================
  Files         719      719              
  Lines       21155    21155              
  Branches     6980     6980              
==========================================
+ Hits        12723    12851     +128     
+ Misses       8356     8229     -127     
+ Partials       76       75       -1     
Flag Coverage Δ
e2e-tests 61.29% <ø> (+0.77%) ⬆️
unit-tests 21.19% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 26 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@zzmp zzmp temporarily deployed to false May 20, 2023 00:09 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 00:09 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 00:09 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 00:09 — with GitHub Actions Inactive
@cypress
Copy link

cypress bot commented May 20, 2023

1 flaky tests on run #11142 ↗︎

0 69 8 0 Flakiness 1

Details:

test(e2e): attempt to de-flake
Project: Uniswap Interface Commit: 8a2fe8fb3e
Status: Passed Duration: 04:56 💡
Started: May 20, 2023 4:08 PM Ended: May 20, 2023 4:13 PM
Flakiness  cypress/e2e/swap/swap.test.ts • 1 flaky test • e2e

View Output Video

Test Artifacts
Swap > Swap on main page > swaps ETH for USDC Output Screenshots Video

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@zzmp zzmp temporarily deployed to false May 20, 2023 00:29 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 00:29 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 00:29 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 00:29 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 00:34 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 04:04 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 04:04 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 04:04 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 04:04 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 04:04 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 04:04 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 04:04 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 04:04 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 15:47 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 15:47 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 15:47 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 15:47 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 15:47 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 15:47 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 15:47 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 15:47 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 16:07 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 16:07 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 16:07 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 16:07 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 16:07 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 16:07 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 16:07 — with GitHub Actions Inactive
@zzmp zzmp temporarily deployed to false May 20, 2023 16:07 — with GitHub Actions Inactive
if (results && results.video) {
// If there were no failures (including flakes), delete the recorded video.
if (!results.tests?.some((test) => test.attempts.some((attempt) => attempt?.state === 'failed'))) {
unlinkSync(results.video)
Copy link
Contributor

Choose a reason for hiding this comment

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

I was surprised to see the node std lib called in here. Are there docs for this pattern you could link to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, but I don't know that it's worth linking to in the cypress config: cypress-io/cypress#16377

Comment on lines -104 to -109
// Set slippage to a high value.
cy.get(getTestSelector('open-settings-dialog-button')).click()
cy.get(getTestSelector('max-slippage-settings')).click()
cy.get(getTestSelector('slippage-input')).clear().type('5')
cy.get('body').click('topRight')
cy.get(getTestSelector('slippage-input')).should('not.exist')
Copy link
Contributor

Choose a reason for hiding this comment

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

I added the slippage setting here to avoid flake I encountered related to network slippage--are you sure about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ran this about 10 times and the only flake I got was in swapping, not here.

@zzmp zzmp merged commit b89ee36 into main May 22, 2023
@zzmp zzmp deleted the de-flake-a-thon branch May 22, 2023 16:02
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.

4 participants