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

[DPE-3257] Fix network cut tests #346

Merged
merged 9 commits into from
Feb 9, 2024
Merged

Conversation

marceloneppel
Copy link
Member

@marceloneppel marceloneppel commented Feb 6, 2024

Issue

The two network cut tests are being skipped from CI due to instabilities on them.

Solution

Enable the tests again on CI.

Fix the causes of the issues in the tests:

  • Fix the removal of the old IP of the unit that was separated from the network of the other units. Sometimes, the old IP was already removed in the leader-elected hook before the leader was able to reconfigure the cluster.
  • In the tests, the IP address of the unit that was separated from the network of the other units was retrieved through juju exec because the IP reported by juju status might be outdated sometimes.
  • Added a check for readiness in the Patroni API and added a retry to the attempt to connect to the database after the network connection was restored (DPE-3489 was created to investigate why it was failing).

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (acc0d26) 80.00% compared to head (53a422a) 79.99%.

Files Patch % Lines
src/charm.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #346      +/-   ##
==========================================
- Coverage   80.00%   79.99%   -0.02%     
==========================================
  Files          10       10              
  Lines        2176     2179       +3     
  Branches      344      345       +1     
==========================================
+ Hits         1741     1743       +2     
- Misses        368      369       +1     
  Partials       67       67              

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

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel marceloneppel changed the title [DPE-3257] Fix network cut test [DPE-3257] Fix network cut tests Feb 7, 2024
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
…cut-test

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel marceloneppel marked this pull request as ready for review February 8, 2024 03:02
Copy link
Contributor

@taurus-forever taurus-forever left a comment

Choose a reason for hiding this comment

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

Excellent! Thank you!

@@ -1633,7 +1633,6 @@ files = [
{file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"},
{file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"},
{file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"},
{file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it constantly flicking? CC: @carlcsaposs-canonical
Each PR removes and re-adds this dependency here.
P.S. ARM.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe different versions of poetry on different developer's machines?

Copy link
Member Author

Choose a reason for hiding this comment

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

I will also do some tests using the Multipass Ubuntu VM here to understand it.

@marceloneppel marceloneppel merged commit 64b65b4 into main Feb 9, 2024
44 checks passed
@marceloneppel marceloneppel deleted the dpe-3257-fix-network-cut-test branch February 9, 2024 13:56
BON4 pushed a commit to BON4/postgresql-operator that referenced this pull request Apr 23, 2024
* Fix network cut test

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Fix network cut test without IP change

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Update unit test

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Fix retrieval of units IPs

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Improve checks for readiness

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Fix IP retrieval

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Fix IP retrieval

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Fix IP retrieval

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

---------

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants