Skip to content

Commit

Permalink
fix(nettests): failing to start a nettest is a warning (#1373)
Browse files Browse the repository at this point in the history
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 authored Oct 18, 2023
1 parent 657fed6 commit 5c93d4c
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 5c93d4c

Please sign in to comment.