Skip to content

Commit 77102af

Browse files
committed
Modified test to repeat the network up and down periods for the duration of the test.
1 parent 1244d64 commit 77102af

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

test/e2e/network_interruption_toxi.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,17 @@ func NetworkInterruptionToxiSpec(ctx context.Context, inputGetter func() CommonS
127127
}
128128

129129
func networkInterruptor(toxiProxyContext *toxiproxy.Context, shutdownChannel chan bool) {
130-
// Wait for ApplyClusterTemplateAndWait() to make some progress
131-
helpers.InterruptibleSleep(15*time.Second, time.Second, shutdownChannel)
130+
for {
131+
// Wait for ApplyClusterTemplateAndWait() to make some progress
132+
helpers.InterruptibleSleep(15*time.Second, time.Second, shutdownChannel)
132133

133-
// Disable communications to ACS
134-
toxiProxyContext.Disable()
134+
// Disable communications to ACS
135+
toxiProxyContext.Disable()
135136

136-
// Leave the network disabled for some period of time
137-
helpers.InterruptibleSleep(30*time.Second, time.Second, shutdownChannel)
137+
// Leave the network disabled for some period of time
138+
helpers.InterruptibleSleep(30*time.Second, time.Second, shutdownChannel)
138139

139-
// Restore communications to ACS
140-
toxiProxyContext.Enable()
140+
// Restore communications to ACS
141+
toxiProxyContext.Enable()
142+
}
141143
}

0 commit comments

Comments
 (0)