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 massive memory leak in unit tests #2537

Merged
merged 1 commit into from
Feb 26, 2021

Conversation

Anviking
Copy link
Member

@Anviking Anviking commented Feb 25, 2021

Issue Number

ADP-758, #2472

Overview

  • Make sure to also close the DBLayers we create!
  • Use validateGenerator to also test non-QSM Arbitrary instances
  • TODO: Look a bit more at the generators / validation of them, could perhaps split the PR too.

Comments

Before this fix the memory usage would steadily climb upwards 5-15GB. Now it's at most ~40 MB.

Running part of unit tests before fix:

ska__rmavbild_2021-02-25_kl _12 34 43

Running all unit tests after fix:

Skärmavbild 2021-02-25 kl  15 54 16

@Anviking Anviking changed the title Fix memory leak in unit tests Fix massive memory leak in unit tests Feb 25, 2021
@Anviking Anviking self-assigned this Feb 25, 2021
@Anviking Anviking marked this pull request as draft February 25, 2021 17:11
@Anviking Anviking force-pushed the anviking/ADP-747/test-generators branch 2 times, most recently from 015f86f to 03cde55 Compare February 26, 2021 08:48
Instead of consuming 10s of GB, we the unit tests only consumes 50 MB at
most. Hopefully this will fix the CI unit test timeouts.
@Anviking Anviking force-pushed the anviking/ADP-747/test-generators branch from 03cde55 to 67f3e6f Compare February 26, 2021 08:58
@Anviking Anviking marked this pull request as ready for review February 26, 2021 09:23
@Anviking Anviking requested review from rvl and KtorZ February 26, 2021 09:23
Copy link
Contributor

@rvl rvl left a comment

Choose a reason for hiding this comment

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

Good stuff

@Anviking
Copy link
Member Author

bors r+

iohk-bors bot added a commit that referenced this pull request Feb 26, 2021
2537: Fix massive memory leak in unit tests r=Anviking a=Anviking

# Issue Number

ADP-758, #2472 

# Overview

- [x] Make sure to also close the DBLayers we create!
- [x] <s>Use validateGenerator to also test non-QSM Arbitrary instances</s>
- [ ] <s>TODO: Look a bit more at the generators / validation of them, could perhaps split the PR too.</s>

# Comments

Before this fix the memory usage would steadily climb upwards 5-15GB. Now it's at most ~40 MB.

### Running part of unit tests before fix:
<img width="1167" alt="ska__rmavbild_2021-02-25_kl _12 34 43" src="https://user-images.githubusercontent.com/304423/109172195-cafd8c00-7782-11eb-8afd-a40732fccded.png">


### Running all unit tests after fix:
<img width="1399" alt="Skärmavbild 2021-02-25 kl  15 54 16" src="https://user-images.githubusercontent.com/304423/109171975-938edf80-7782-11eb-904b-9404708fbdde.png">


<!-- Additional comments or screenshots to attach if any -->

<!--
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
 ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages.
-->


Co-authored-by: Johannes Lund <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 26, 2021

Build failed:

      random 24 words
      icarus 9 words
      icarus 12 words
      icarus 15 words
      icarus 18 words
building of '/nix/store/fry66wk8rw9wb7r7aa7nn462kw9ray02-cardano-wallet-test-integration-2021.2.15-check' timed out after 900 seconds of silence

#2540

@Anviking
Copy link
Member Author

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 26, 2021

Build succeeded:

@iohk-bors iohk-bors bot merged commit e45ff29 into master Feb 26, 2021
@iohk-bors iohk-bors bot deleted the anviking/ADP-747/test-generators branch February 26, 2021 11:42
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.

2 participants