From c37991cf8b6d2694e609605e5beaa5513c4131f0 Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Tue, 16 Jan 2024 15:58:56 +0100 Subject: [PATCH] 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 --- tests/robustness/validate/validate.go | 3 ++- tests/robustness/validate/watch.go | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/robustness/validate/validate.go b/tests/robustness/validate/validate.go index 240ce70fa..704fe5f2d 100644 --- a/tests/robustness/validate/validate.go +++ b/tests/robustness/validate/validate.go @@ -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) diff --git a/tests/robustness/validate/watch.go b/tests/robustness/validate/watch.go index 8580d1a48..194ba65de 100644 --- a/tests/robustness/validate/watch.go +++ b/tests/robustness/validate/watch.go @@ -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) + } } }