fix: increase the maximum simulation duration to two hours

This commit is contained in:
徐聪
2024-07-19 14:23:49 +08:00
parent 99757954c6
commit 831419a25c
3 changed files with 7 additions and 5 deletions

View File

@@ -42,7 +42,7 @@ func init() {
runCmd.Flags().BoolVarP(&continueOnFailure, "continue-on-failure", "c", false, "continue running next step when failure occurs")
runCmd.Flags().BoolVar(&requestsLogOff, "log-requests-off", false, "turn off request & response details logging")
runCmd.Flags().BoolVar(&httpStatOn, "http-stat", false, "turn on HTTP latency stat (DNSLookup, TCP Connection, etc.)")
runCmd.Flags().BoolVar(&pluginLogOn, "log-plugin", true, "turn on plugin logging")
runCmd.Flags().BoolVar(&pluginLogOn, "log-plugin", false, "turn on plugin logging")
runCmd.Flags().StringVarP(&proxyUrl, "proxy-url", "p", "", "set proxy url")
runCmd.Flags().BoolVarP(&saveTests, "save-tests", "s", false, "save tests summary")
runCmd.Flags().BoolVarP(&genHTMLReport, "gen-html-report", "g", false, "generate html report")

View File

@@ -1 +1 @@
v4.3.8.202405262130
v4.3.8.202406252100

View File

@@ -188,7 +188,7 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
if err != nil || currentVideo.Type == "" {
crawler.failedCount++
if crawler.failedCount >= 3 {
// failed 10 consecutive times
// failed 3 consecutive times
return errors.Wrap(code.TrackingGetError,
"get current feed video failed 3 consecutive times")
}
@@ -270,7 +270,8 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
}
// simulation watch feed video
sleepStrict(swipeFinishTime, currentVideo.PlayDuration)
simulationPlayDuration := math.Min(float64(currentVideo.PlayDuration), 7200000)
sleepStrict(swipeFinishTime, int64(simulationPlayDuration))
screenResult.Video = currentVideo
screenResult.Resolution = dExt.windowSize
@@ -318,7 +319,8 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
dExt.cacheStepData.screenResults[time.Now().String()] = screenResult
// simulation watch feed video
sleepStrict(swipeFinishTime, currentVideo.PlayDuration)
simulationPlayDuration := math.Min(float64(currentVideo.PlayDuration), 7200000)
sleepStrict(swipeFinishTime, int64(simulationPlayDuration))
screenResult.TotalElapsed = time.Since(swipeFinishTime).Milliseconds()
}