Skip to content

Commit

Permalink
fix(stunreachability): don't emit spurious progress events
Browse files Browse the repository at this point in the history
See ooni/probe#2058 (comment)

This diff WILL need to be forwardported to master.
  • Loading branch information
bassosimone committed Jun 6, 2022
1 parent 9e41c4f commit 4fb5f7d
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package stunreachability
import (
"context"
"errors"
"fmt"
"net"
"net/url"
"time"
Expand Down Expand Up @@ -109,9 +108,6 @@ func (tk *TestKeys) run(
measurement *model.Measurement, callbacks model.ExperimentCallbacks,
endpoint string,
) error {
callbacks.OnProgress(0, fmt.Sprintf("stunreachability: measuring: %s...", endpoint))
defer callbacks.OnProgress(
1, fmt.Sprintf("stunreachability: measuring: %s... done", endpoint))
tk.Endpoint = endpoint
saver := new(trace.Saver)
begin := time.Now()
Expand All @@ -122,6 +118,7 @@ func (tk *TestKeys) run(
ReadWriteSaver: saver,
ResolveSaver: saver,
}), endpoint)
sess.Logger().Infof("stunreachability: measuring: %s... %s", endpoint, model.ErrorToStringOrOK(err))
events := saver.Read()
tk.NetworkEvents = append(
tk.NetworkEvents, archival.NewNetworkEventsList(begin, events)...,
Expand Down

0 comments on commit 4fb5f7d

Please sign in to comment.