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

Test mutual failover setup #84

Merged
merged 2 commits into from
Apr 9, 2020
Merged

Test mutual failover setup #84

merged 2 commits into from
Apr 9, 2020

Conversation

ytsarev
Copy link
Member

@ytsarev ytsarev commented Apr 8, 2020

--- PASS: TestOhmyglbSplitFailoverExample (230.45s)
    --- PASS: TestOhmyglbSplitFailoverExample/Each_cluster_resolves_its_own_set_of_IP_addresses (30.53s)
    --- PASS: TestOhmyglbSplitFailoverExample/serviceHealth_becomes_Unhealthy_after_scaling_down_to_0 (10.17s)
    --- PASS: TestOhmyglbSplitFailoverExample/Cluster_1_failovers_to_Cluster_2 (61.28s)
    --- PASS: TestOhmyglbSplitFailoverExample/Cluster_2_still_returns_own_entries (0.07s)

* Resolves #67
* Proves expected behavior of primary-primary failover setup
* Move common test function to `helpers.go`

```
--- PASS: TestOhmyglbSplitFailoverExample (230.45s)
    --- PASS: TestOhmyglbSplitFailoverExample/Each_cluster_resolves_its_own_set_of_IP_addresses (30.53s)
    --- PASS: TestOhmyglbSplitFailoverExample/serviceHealth_becomes_Unhealthy_after_scaling_down_to_0 (10.17s)
    --- PASS: TestOhmyglbSplitFailoverExample/Cluster_1_failovers_to_Cluster_2 (61.28s)
    --- PASS: TestOhmyglbSplitFailoverExample/Cluster_2_still_returns_own_entries (0.07s)
```
assert.Equal(t, afterFailoverResponse, expectedIPsCluster2)
})

t.Run("Cluster 2 still returns own entries", func(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@ytsarev would it be worth adding an additional step. Test if the service from Cluster 1 becomes healthy once more, that Cluster 1 should then continue to resolve its own IP addresses? I.e. it fails back again.

So:

  1. Cluster 1 resolves it's own addresses
  2. Service becomes unhealthy on Cluster 1
  3. Cluster 2 addresses are now resolved only
  4. Service becomes healthy again on Cluster 1
  5. Cluster 1 once again resolves it's own addresses

Copy link
Member Author

Choose a reason for hiding this comment

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

totally, will add this step, thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

@donovanmuller implemented, please review

@ytsarev ytsarev requested a review from donovanmuller April 9, 2020 13:47
@ytsarev ytsarev merged commit fec4a44 into master Apr 9, 2020
@ytsarev ytsarev deleted the failover_split branch April 9, 2020 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants