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

end-to-end tests: refactor and fix flaky tests #2470

Merged
merged 47 commits into from
Jun 10, 2022

Conversation

qdm12
Copy link
Contributor

@qdm12 qdm12 commented Apr 6, 2022

💡 Review commit by commit by starting with the first commit

Changes

TLDR

  • Fix flakky tests and add testing depth
  • More robust code
  • Detect runtime errors
  • Better concerns separation
  • Can easily run a single test independently & locally (after make gossamer)

Details

Tests

  • RPC suite passing
  • Stress tests passing

Issues

See issues mentioned in changes above.

Indirectly fixed: #2165

Primary Reviewer

@qdm12 qdm12 changed the title Qdm12/tests refactor tip end-to-end tests: refactor and fix flaky tests Apr 6, 2022
@qdm12 qdm12 force-pushed the qdm12/tests-refactor-tip branch 5 times, most recently from 23c4806 to cce2193 Compare April 6, 2022 21:28
@codecov
Copy link

codecov bot commented Apr 6, 2022

Codecov Report

Merging #2470 (c1271b2) into development (6d22c23) will increase coverage by 0.00%.
The diff coverage is 28.07%.

@@             Coverage Diff              @@
##           development    #2470   +/-   ##
============================================
  Coverage        57.34%   57.34%           
============================================
  Files              215      215           
  Lines            28417    28407   -10     
============================================
- Hits             16296    16291    -5     
+ Misses           10442    10440    -2     
+ Partials          1679     1676    -3     
Flag Coverage Δ
unit-tests 57.34% <28.07%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
dot/utils.go 50.00% <ø> (+16.66%) ⬆️
lib/runtime/constants.go 0.00% <ø> (ø)
lib/runtime/test_helpers.go 7.94% <0.00%> (-0.65%) ⬇️
lib/utils/utils.go 17.48% <0.00%> (-0.20%) ⬇️
dot/peerset/peerset.go 49.34% <42.85%> (-0.23%) ⬇️
dot/state/epoch.go 49.53% <50.00%> (+0.23%) ⬆️
lib/runtime/life/test_helpers.go 100.00% <100.00%> (ø)
lib/runtime/wasmer/test_helpers.go 100.00% <100.00%> (ø)
dot/network/host.go 64.31% <0.00%> (-1.07%) ⬇️
lib/trie/database.go 50.30% <0.00%> (-0.93%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2fa5d8a...c1271b2. Read the comment docs.

@qdm12 qdm12 force-pushed the qdm12/tests-refactor-tip branch 9 times, most recently from 3287691 to d02eb44 Compare April 11, 2022 19:43
@qdm12 qdm12 marked this pull request as ready for review April 11, 2022 20:04
@qdm12 qdm12 force-pushed the qdm12/tests-refactor-tip branch 4 times, most recently from dc36f16 to bd18ecd Compare April 27, 2022 12:25
@qdm12 qdm12 force-pushed the qdm12/tests-refactor-tip branch from bd18ecd to 85c38a5 Compare April 27, 2022 14:12
qdm12 and others added 23 commits June 10, 2022 19:31
- Use `Decode` from rpc package instead
- Add fields to RPC server response struct
Co-authored-by: Timothy Wu <timwu20@gmail.com>
- Add `fetchWithTimeout` helper function
- Change test cases slices to individual subtests
- Add `t.SkipNow()` to parent tests where all subtests are skipped
- Make `TestChainRPC` event driven and increase testing depth
- Add a few `TODO`s to increase testing depth
- Run each query call in parallel
- Refactor websocket code
- Assert things and increase test depth
- Graceful shutdown of websocket
- Use Go to implement `integration-test-all.sh` directly in single 'stable' test
- The test is fast and only does RPC calls, it should be part of the RPC workflow
- Remove stable workflow from Makefile, github workflows directory and document
@qdm12 qdm12 force-pushed the qdm12/tests-refactor-tip branch from ff87feb to f0e0187 Compare June 10, 2022 19:32
@qdm12 qdm12 merged commit 6220402 into development Jun 10, 2022
@qdm12 qdm12 deleted the qdm12/tests-refactor-tip branch June 10, 2022 21:10
rrtti pushed a commit to polkadot-fellows/seeding that referenced this pull request Sep 29, 2022
I am Quentin Mc Gaw, a software engineer working the Go Polkadot host **Gossamer**.
I have been working full time on Gossamer since October 2021, mostly on the state trie and storage.
I have also made a [few minor pull requests](https://github.com/w3f/polkadot-spec/pulls?q=is%3Apr+is%3Aclosed+author%3Aqdm12) to the Polkadot specification repository.

I am requesting to join the Fellowship at rank 1.

## Main contributions

### Gossamer

- Fix memory leaks
  - Trie encoding buffer pools usage fixed [#2009](ChainSafe/gossamer#2009)
  - Fix state map of tries memory leak [#2286](ChainSafe/gossamer#2286)
  - Fix sync benchmark [#2234](ChainSafe/gossamer#2234)
- Trie proof fixes ([#2604](ChainSafe/gossamer#2604), [#2661](ChainSafe/gossamer#2661))
- Fix end to end tests orchestration ([#2470](ChainSafe/gossamer#2470), [#2452](ChainSafe/gossamer#2452), [#2385](ChainSafe/gossamer#2385), [#2370](ChainSafe/gossamer#2370))
- State trie statistics ([#2378](ChainSafe/gossamer#2378), [#2310](ChainSafe/gossamer#2310), [#2272](ChainSafe/gossamer#2272))
- State trie fixes and improvements
  - Only deep copy nodes when mutation is certain [#2352](ChainSafe/gossamer#2352) and [#2223](ChainSafe/gossamer#2223)
  - Only deep copy necessary fields of a node [#2384](ChainSafe/gossamer#2384)
  - Use Merkle values for database keys instead of always hash [#2725](ChainSafe/gossamer#2725)
  - Opportunistic parallel Merkle value commputing [#2081](ChainSafe/gossamer#2081)
- Grandpa capped number of tracked messages ([#2490](ChainSafe/gossamer#2490), [#2485](ChainSafe/gossamer#2485))
- Add pprof HTTP service for profiling [#1991](ChainSafe/gossamer#1991)

Ongoing work:

- State trie lazy loading and caching
- State trie v1 support ([#2736](ChainSafe/gossamer#2736), [#2747](ChainSafe/gossamer#2747), [#2687](ChainSafe/gossamer#2687), [#2686](ChainSafe/gossamer#2686), [#2685](ChainSafe/gossamer#2685), [#2673](ChainSafe/gossamer#2673), [#2611](ChainSafe/gossamer#2611), [#2530](ChainSafe/gossamer#2530))

### Polkadot specification

➡️ [Pull requests from qdm12](https://github.com/w3f/polkadot-spec/pulls?q=is%3Apr+is%3Aclosed+author%3Aqdm12)
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.

Fix Flaky Tests in TestSync_Basic Fix Flaky Tests in TestSystemRPC
3 participants