Przeglądaj źródła

chore: potential crash in unit tests

jamesread 4 miesięcy temu
rodzic
commit
9080577f2b
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      service/internal/executor/executor_test.go

+ 4 - 1
service/internal/executor/executor_test.go

@@ -469,7 +469,10 @@ func TestTriggerUnknownActionTitleSkipsWithoutPanic(t *testing.T) {
 	case <-time.After(500 * time.Millisecond):
 	}
 	assert.Len(t, got, 1, "only the triggering action runs; unknown trigger is skipped")
-	assert.Equal(t, "Action with bad trigger", got[0])
+
+	if len(got) > 0 {
+		assert.Equal(t, "Action with bad trigger", got[0])
+	}
 }
 
 type executionFinishedCollector struct {