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: Improve BFT Tests Stability #1385

Merged
merged 8 commits into from
Dec 7, 2023
Merged

Conversation

gfanton
Copy link
Member

@gfanton gfanton commented Nov 20, 2023

ref #1320

This draft PR demonstrates a way for fixing flaky BFT tests.
As mentioned in #1320 the main issue is that some channels are not fully consumed, leading to deadlocks. By using buffered channels as proxy in state tests, we can easily avoid these deadlocks. However, I don't think this is the best approach, as these channels were originally set to zero (capacity) for good reasons, but perhaps it could make sense for testing purposes.
In any case, if anyone has a better idea for a solution, your suggestions are welcome.

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@github-actions github-actions bot added the 📦 🌐 tendermint v2 Issues or PRs tm2 related label Nov 20, 2023
@gfanton gfanton changed the title fix: use different listener ID to better identify stuck channel fix: Improving BFT Tests Stability Nov 20, 2023
Copy link

codecov bot commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5a0ff55) 56.30% compared to head (0a45ce4) 56.11%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1385      +/-   ##
==========================================
- Coverage   56.30%   56.11%   -0.20%     
==========================================
  Files         422      413       -9     
  Lines       65699    64129    -1570     
==========================================
- Hits        36993    35983    -1010     
+ Misses      25821    25318     -503     
+ Partials     2885     2828      -57     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gfanton gfanton changed the title fix: Improving BFT Tests Stability fix: Improve BFT Tests Stability Nov 20, 2023
@gfanton gfanton marked this pull request as ready for review December 7, 2023 15:02
@gfanton gfanton requested review from jaekwon and moul as code owners December 7, 2023 15:02
@thehowl
Copy link
Member

thehowl commented Dec 7, 2023

Approving for a green CI! 🎉

Copy link
Member

@moul moul left a comment

Choose a reason for hiding this comment

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

Please open an issue, mandatory for the mainnet to address the root cause.

@moul moul merged commit 63ff15b into gnolang:master Dec 7, 2023
15 checks passed
@jaekwon
Copy link
Contributor

jaekwon commented Dec 15, 2023

We should revert this: #1320 (comment)

gfanton added a commit to gfanton/gno that referenced this pull request Dec 15, 2023
moul pushed a commit that referenced this pull request Dec 17, 2023
This PR reverts #1385 following @jaekwon
#1320 (comment)

<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

Signed-off-by: gfanton <[email protected]>
gfanton added a commit to moul/gno that referenced this pull request Jan 18, 2024
ref gnolang#1320 

This draft PR demonstrates a way for fixing flaky BFT tests. 
As mentioned in gnolang#1320 the main issue is that some channels are not fully
consumed, leading to deadlocks. By using buffered channels as proxy in
state tests, we can easily avoid these deadlocks. However, I don't think
this is the best approach, as these channels were originally set to zero
(capacity) for good reasons, but perhaps it could make sense for testing
purposes.
In any case, if anyone has a better idea for a solution, your
suggestions are welcome.

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

---------

Signed-off-by: gfanton <[email protected]>
Co-authored-by: Manfred Touron <[email protected]>
gfanton added a commit to moul/gno that referenced this pull request Jan 18, 2024
This PR reverts gnolang#1385 following @jaekwon
gnolang#1320 (comment)

<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

Signed-off-by: gfanton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related
Projects
Status: Done
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants