[forwardport] fix(stunreachability): don't emit spurious progress events (#803)
This diff forward ports 4fb5f7de69b900cfc2bd211f723108a67bda350d to master. See https://github.com/ooni/probe/issues/2058#issuecomment-1145847069 This diff WILL need to be forwardported to master.
This commit is contained in:
parent
504181906a
commit
4cf58380c3
2 changed files with 16 additions and 9 deletions
|
|
@ -6,7 +6,6 @@ package stunreachability
|
|||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/url"
|
||||
"time"
|
||||
|
|
@ -108,9 +107,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(tracex.Saver)
|
||||
begin := time.Now()
|
||||
|
|
@ -120,6 +116,7 @@ func (tk *TestKeys) run(
|
|||
ReadWriteSaver: saver,
|
||||
Saver: saver,
|
||||
}), endpoint)
|
||||
sess.Logger().Infof("stunreachability: measuring: %s... %s", endpoint, model.ErrorToStringOrOK(err))
|
||||
events := saver.Read()
|
||||
tk.NetworkEvents = append(
|
||||
tk.NetworkEvents, tracex.NewNetworkEventsList(begin, events)...,
|
||||
|
|
|
|||
Loading…
Reference in a new issue