Validate watch even if event history cannot be created

Creation of event history requires each client to return consistent
events. If clients observed inconsistent view of some revision, merging
will fail and return diff between two clients. This however doesn't
provide hint on what kind of issue happend.

This PR helps cases where there is an error with single watch
stream (like event duplication) by running normal watch validation even
without full event history.

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
This commit is contained in:
Marek Siarkowicz 2024-01-16 15:58:56 +01:00
parent ed994248e0
commit c37991cf8b
2 changed files with 6 additions and 3 deletions

View File

@ -38,7 +38,8 @@ func ValidateAndReturnVisualize(t *testing.T, lg *zap.Logger, cfg Config, report
// TODO: Don't use watch events to get event history.
eventHistory, err := mergeWatchEventHistory(reports)
if err != nil {
t.Errorf("Failed merging watch history to create event history, skipping further validation, err: %s", err)
t.Errorf("Failed merging watch history to create event history, err: %s", err)
validateWatch(t, lg, cfg, reports, nil)
return visualize
}
validateWatch(t, lg, cfg, reports, eventHistory)

View File

@ -31,8 +31,10 @@ func validateWatch(t *testing.T, lg *zap.Logger, cfg Config, reports []report.Cl
validateUnique(t, cfg.ExpectRevisionUnique, r)
validateAtomic(t, r)
validateBookmarkable(t, r)
validateReliable(t, eventHistory, r)
validateResumable(t, eventHistory, r)
if eventHistory != nil {
validateReliable(t, eventHistory, r)
validateResumable(t, eventHistory, r)
}
}
}