Skip to content

Commit

Permalink
Review comments.
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Simpson <[email protected]>
  • Loading branch information
stevesg committed Jun 10, 2021
1 parent 957dbb2 commit a08bf5f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions integration/integration_memberlist_single_binary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"time"

"github.com/stretchr/testify/require"
"golang.org/x/sync/errgroup"

"github.com/cortexproject/cortex/integration/ca"
"github.com/cortexproject/cortex/integration/e2e"
Expand Down Expand Up @@ -167,7 +168,7 @@ func TestSingleBinaryWithMemberlistScaling(t *testing.T) {
name := fmt.Sprintf("cortex-%d", i+1)
join := ""
if i > 0 {
join = fmt.Sprintf("%s-cortex-1:8000", networkName)
join = e2e.NetworkContainerHostPort(networkName, "cortex-1", 8000)
}
c := newSingleBinary(name, "", join)
require.NoError(t, s.StartAndWaitReady(c))
Expand All @@ -183,11 +184,14 @@ func TestSingleBinaryWithMemberlistScaling(t *testing.T) {

// Scale down as fast as possible but cleanly, in order to send out tombstones.

stop := errgroup.Group{}
for len(instances) > minCortex {
i := len(instances) - 1
require.NoError(t, s.Stop(instances[i]))
c := instances[i]
instances = instances[:i]
stop.Go(func() error { return s.Stop(c) })
}
require.NoError(t, stop.Wait())

// If all is working as expected, then tombstones should have propagated easily within this time period.
// The logging is mildly spammy, but it has proven extremely useful for debugging convergence cases.
Expand Down

0 comments on commit a08bf5f

Please sign in to comment.