Skip to content

Commit

Permalink
fix: disable maxRuntime when not WebConnectivity
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Apr 6, 2021
1 parent 51459e2 commit 6306c09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion cmd/ooniprobe/internal/nettests/nettests.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ func (c *Controller) Run(builder *engine.ExperimentBuilder, inputs []string) err
log.Debug("disabling maxRuntime when running in the background")
maxRuntime = 0
}
_, isWebConnectivity := c.nt.(WebConnectivity)
if !isWebConnectivity {
log.Debug("disabling maxRuntime without Web Connectivity")
maxRuntime = 0
}
start := time.Now()
c.ntStartTime = start
for idx, input := range inputs {
Expand Down Expand Up @@ -214,7 +219,8 @@ func (c *Controller) Run(builder *engine.ExperimentBuilder, inputs []string) err
func (c *Controller) OnProgress(perc float64, msg string) {
// when we have maxRuntime, honor it
maxRuntime := time.Duration(c.Probe.Config().Nettests.WebsitesMaxRuntime) * time.Second
if c.RunType == "manual" && maxRuntime > 0 {
_, isWebConnectivity := c.nt.(WebConnectivity)
if c.RunType == "manual" && maxRuntime > 0 && isWebConnectivity {
elapsed := time.Since(c.ntStartTime)
perc = float64(elapsed) / float64(maxRuntime)
eta := maxRuntime.Seconds() - elapsed.Seconds()
Expand Down
2 changes: 1 addition & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package version

const (
// Version is the software version
Version = "3.9.0"
Version = "3.9.1"
)

0 comments on commit 6306c09

Please sign in to comment.