Skip to content

Commit 0c8434c

Browse files
committed
first wait for FI action, then assert notification
1 parent 61998d5 commit 0c8434c

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

maintnotifications/e2e/scenario_timeout_configs_test.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,17 @@ func TestTimeoutConfigurationsPushNotifications(t *testing.T) {
250250
ef("Failed to trigger migrate action for %s: %v", timeoutTest.name, err)
251251
}
252252

253+
// Wait for migration to complete
254+
status, err = faultInjector.WaitForAction(ctx, migrateResp.ActionID,
255+
WithMaxWaitTime(240*time.Second),
256+
WithPollInterval(2*time.Second),
257+
)
258+
if err != nil {
259+
ef("[FI] Migrate action failed for %s: %v", timeoutTest.name, err)
260+
}
261+
262+
p("[FI] Migrate action completed for %s: %s", timeoutTest.name, status.Status)
263+
253264
// Wait for MIGRATING notification
254265
match, found = logCollector.WaitForLogMatchFunc(func(s string) bool {
255266
return strings.Contains(s, logs2.ProcessingNotificationMessage) && strings.Contains(s, "MIGRATING")
@@ -260,15 +271,6 @@ func TestTimeoutConfigurationsPushNotifications(t *testing.T) {
260271
migrateData := logs2.ExtractDataFromLogMessage(match)
261272
p("MIGRATING notification received for %s: %v", timeoutTest.name, migrateData)
262273

263-
// Wait for migration to complete
264-
status, err = faultInjector.WaitForAction(ctx, migrateResp.ActionID,
265-
WithMaxWaitTime(240*time.Second),
266-
WithPollInterval(2*time.Second),
267-
)
268-
if err != nil {
269-
ef("[FI] Migrate action failed for %s: %v", timeoutTest.name, err)
270-
}
271-
p("[FI] Migrate action completed for %s: %s", timeoutTest.name, status.Status)
272274

273275
// do a bind action
274276
bindResp, err := faultInjector.TriggerAction(ctx, ActionRequest{

0 commit comments

Comments
 (0)