Skip to content

Commit f1a4f46

Browse files
committed
wait for action to get the response
1 parent c74156f commit f1a4f46

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

maintnotifications/e2e/scenario_endpoint_types_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func TestEndpointTypesPushNotifications(t *testing.T) {
157157
}()
158158

159159
// Test failover with this endpoint type
160-
p("Testing failover with %s endpoint type...", endpointTest.name)
160+
p("Testing failover with %s endpoint type on database %s[bdb_id:%s]...", endpointTest.name, endpointConfig.Name, endpointConfig.BdbID)
161161
failoverResp, err := faultInjector.TriggerAction(ctx, ActionRequest{
162162
Type: "failover",
163163
Parameters: map[string]interface{}{
@@ -173,6 +173,16 @@ func TestEndpointTypesPushNotifications(t *testing.T) {
173173
commandsRunner.FireCommandsUntilStop(ctx)
174174
}()
175175

176+
// Wait for failover to complete
177+
status, err := faultInjector.WaitForAction(ctx, failoverResp.ActionID,
178+
WithMaxWaitTime(240*time.Second),
179+
WithPollInterval(2*time.Second),
180+
)
181+
if err != nil {
182+
ef("[FI] Failover action failed for %s: %v", endpointTest.name, err)
183+
}
184+
p("[FI] Failover action completed for %s: %s %s", endpointTest.name, status.Status, actionOutputIfFailed(status))
185+
176186
// Wait for FAILING_OVER notification
177187
match, found := logCollector.MatchOrWaitForLogMatchFunc(func(s string) bool {
178188
return strings.Contains(s, logs2.ProcessingNotificationMessage) && notificationType(s, "FAILING_OVER")
@@ -195,16 +205,6 @@ func TestEndpointTypesPushNotifications(t *testing.T) {
195205
failedOverData := logs2.ExtractDataFromLogMessage(match)
196206
p("FAILED_OVER notification received for %s. %v", endpointTest.name, failedOverData)
197207

198-
// Wait for failover to complete
199-
status, err := faultInjector.WaitForAction(ctx, failoverResp.ActionID,
200-
WithMaxWaitTime(240*time.Second),
201-
WithPollInterval(2*time.Second),
202-
)
203-
if err != nil {
204-
ef("[FI] Failover action failed for %s: %v", endpointTest.name, err)
205-
}
206-
p("[FI] Failover action completed for %s: %s %s", endpointTest.name, status.Status, actionOutputIfFailed(status))
207-
208208
// Test migration with this endpoint type
209209
p("Testing migration with %s endpoint type...", endpointTest.name)
210210
migrateResp, err := faultInjector.TriggerAction(ctx, ActionRequest{

0 commit comments

Comments
 (0)