Skip to content

Commit 93ef6cc

Browse files
committed
fix tests
1 parent d8d55f9 commit 93ef6cc

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

maintnotifications/e2e/scenario_endpoint_types_test.go

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ func TestEndpointTypesPushNotifications(t *testing.T) {
8686
t.Run(endpointTest.name, func(t *testing.T) {
8787
// Clear logs between endpoint type tests
8888
logCollector.Clear()
89-
dump = true // reset dump flag
89+
// reset errors detected flag
90+
errorsDetected = false
91+
// reset dump flag
92+
dump = true
9093
// redefine p and e for each test to get
9194
// proper test name in logs and proper test failures
9295
var p = func(format string, args ...interface{}) {
@@ -229,16 +232,6 @@ func TestEndpointTypesPushNotifications(t *testing.T) {
229232
ef("Failed to trigger migrate action for %s: %v", endpointTest.name, err)
230233
}
231234

232-
// Wait for MIGRATING notification
233-
match, found = logCollector.WaitForLogMatchFunc(func(s string) bool {
234-
return strings.Contains(s, logs2.ProcessingNotificationMessage) && strings.Contains(s, "MIGRATING")
235-
}, 60*time.Second)
236-
if !found {
237-
ef("MIGRATING notification was not received for %s endpoint type", endpointTest.name)
238-
}
239-
migrateData := logs2.ExtractDataFromLogMessage(match)
240-
p("MIGRATING notification received for %s: %v", endpointTest.name, migrateData)
241-
242235
// Wait for migration to complete
243236
status, err = faultInjector.WaitForAction(ctx, migrateResp.ActionID,
244237
WithMaxWaitTime(240*time.Second),
@@ -249,6 +242,16 @@ func TestEndpointTypesPushNotifications(t *testing.T) {
249242
}
250243
p("[FI] Migrate action completed for %s: %s", endpointTest.name, status.Status)
251244

245+
// Wait for MIGRATING notification
246+
match, found = logCollector.WaitForLogMatchFunc(func(s string) bool {
247+
return strings.Contains(s, logs2.ProcessingNotificationMessage) && strings.Contains(s, "MIGRATING")
248+
}, 60*time.Second)
249+
if !found {
250+
ef("MIGRATING notification was not received for %s endpoint type", endpointTest.name)
251+
}
252+
migrateData := logs2.ExtractDataFromLogMessage(match)
253+
p("MIGRATING notification received for %s: %v", endpointTest.name, migrateData)
254+
252255
// Wait for MIGRATED notification
253256
seqIDToObserve = int64(migrateData["seqID"].(float64))
254257
connIDToObserve = uint64(migrateData["connID"].(float64))

maintnotifications/e2e/scenario_push_notifications_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ func TestPushNotifications(t *testing.T) {
379379
if len(movingNotification) != 4 {
380380
p("[NOTICE] Invalid MOVING notification format: %s", movingNotification)
381381
}
382-
mNotifTimeS, err := strconv.Atoi(movingNotification[2].(string))
382+
mNotifTimeS, err := movingNotification[2].(int64)
383383
if err != nil {
384384
p("[NOTICE] Invalid timeS in MOVING notification: %s", movingNotification)
385385
}

0 commit comments

Comments
 (0)