From 7c4e537f775702660ddc0596e73c82f69402aa83 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Wed, 18 Oct 2023 18:34:00 +0200 Subject: [PATCH] fix(nettests): failing to start a nettest is a warning This diff backports #1373 to the release/3.19 branch. Emitting an error causes ooni/probe-desktop to try to generate a warning window that (1) is a bit unpleasant to visually see and (2) more importantly is not proper to show, given that we have default-disabled experiments right now. Also, in my book, we should emit warning if we continue running and errors when we stop. (Maybe it's not the best book considering that assumes that all errors are fatal; in any case, try to be consistent with this convention.) See https://github.com/ooni/probe/issues/2576 for extra information. --- cmd/ooniprobe/internal/nettests/run.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/ooniprobe/internal/nettests/run.go b/cmd/ooniprobe/internal/nettests/run.go index 25385a647..503124aae 100644 --- a/cmd/ooniprobe/internal/nettests/run.go +++ b/cmd/ooniprobe/internal/nettests/run.go @@ -78,7 +78,7 @@ func RunGroup(config RunGroupConfig) error { return err } if err := sess.MaybeLookupBackends(); err != nil { - log.WithError(err).Warn("Failed to discover OONI backends") + log.WithError(err).Errorf("Failed to discover OONI backends") return err } @@ -116,7 +116,9 @@ func RunGroup(config RunGroupConfig) error { ctl.RunType = config.RunType ctl.SetNettestIndex(i, len(group.Nettests)) if err = nt.Run(ctl); err != nil { - log.WithError(err).Errorf("Failed to run %s", group.Label) + // We used to emit an error here, now we emit a warning--the proper choice + // given that we continue running. See https://github.com/ooni/probe/issues/2576. + log.WithError(err).Warnf("Failed to run %s", group.Label) } }