Skip to content

Commit

Permalink
[DPE-4897]: Stabilize sharding race condition tests (#435)
Browse files Browse the repository at this point in the history
## Issue

* The sharding race condition test is flaky.
* The test and the code seemed good on the Sharding side.
* There was actually another race condition which was making this test
flaky.

## Solution

* The race condition that was happening is the following: the config
server can run the `RelationJoined` hook before the shard has run
`RelationCreated`. The `RelationJoined` hook relies on some information
sent by the `RelationCreated` hook to succeed. The solution is hence to
defer this event in the case we have some incompatible versions between
shards and config server, or if we are missing those shards. This is
done also for the shard because otherwise, the same issue could happen,
we dropped the event and would never sync the credentials.
* This patch reuses the already existing code as much at it can.
* Adds some tests to ensure that this never happens againt

## Miscellaneous

 * Fix some small issues in the `test_config_server_lib.py` tests.
  • Loading branch information
Gu1nness authored Jul 24, 2024
1 parent 1eaae43 commit eeac0fd
Show file tree
Hide file tree
Showing 6 changed files with 344 additions and 126 deletions.
2 changes: 1 addition & 1 deletion charm_internal_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2
3
Loading

0 comments on commit eeac0fd

Please sign in to comment.