Skip to content

Commit

Permalink
fix(nettests): failing to start a nettest is a warning
Browse files Browse the repository at this point in the history
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 ooni/probe#2576 for extra information.
  • Loading branch information
bassosimone committed Oct 18, 2023
1 parent 2942d67 commit 7c4e537
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/ooniprobe/internal/nettests/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 7c4e537

Please sign in to comment.