@@ -12,6 +12,7 @@ import (
1212 "time"
1313
1414 "github.com/stretchr/testify/require"
15+ "golang.org/x/sync/errgroup"
1516
1617 "github.com/cortexproject/cortex/integration/ca"
1718 "github.com/cortexproject/cortex/integration/e2e"
@@ -167,7 +168,7 @@ func TestSingleBinaryWithMemberlistScaling(t *testing.T) {
167168 name := fmt .Sprintf ("cortex-%d" , i + 1 )
168169 join := ""
169170 if i > 0 {
170- join = fmt . Sprintf ( "%s- cortex-1:8000 " , networkName )
171+ join = e2e . NetworkContainerHostPort ( networkName , " cortex-1" , 8000 )
171172 }
172173 c := newSingleBinary (name , "" , join )
173174 require .NoError (t , s .StartAndWaitReady (c ))
@@ -183,11 +184,14 @@ func TestSingleBinaryWithMemberlistScaling(t *testing.T) {
183184
184185 // Scale down as fast as possible but cleanly, in order to send out tombstones.
185186
187+ stop := errgroup.Group {}
186188 for len (instances ) > minCortex {
187189 i := len (instances ) - 1
188- require . NoError ( t , s . Stop ( instances [i ]))
190+ c := instances [i ]
189191 instances = instances [:i ]
192+ stop .Go (func () error { return s .Stop (c ) })
190193 }
194+ require .NoError (t , stop .Wait ())
191195
192196 // If all is working as expected, then tombstones should have propagated easily within this time period.
193197 // The logging is mildly spammy, but it has proven extremely useful for debugging convergence cases.
0 commit comments