From 831419a25c14fe70142f146f602de79acc9897f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E8=81=AA?= Date: Fri, 19 Jul 2024 14:23:49 +0800 Subject: [PATCH] fix: increase the maximum simulation duration to two hours --- hrp/cmd/run.go | 2 +- hrp/internal/version/VERSION | 2 +- hrp/pkg/uixt/video_crawler.go | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hrp/cmd/run.go b/hrp/cmd/run.go index cb14a8c3..e042a5b7 100644 --- a/hrp/cmd/run.go +++ b/hrp/cmd/run.go @@ -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") diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION index ff0d643e..e65344f9 100644 --- a/hrp/internal/version/VERSION +++ b/hrp/internal/version/VERSION @@ -1 +1 @@ -v4.3.8.202405262130 \ No newline at end of file +v4.3.8.202406252100 \ No newline at end of file diff --git a/hrp/pkg/uixt/video_crawler.go b/hrp/pkg/uixt/video_crawler.go index 28af0ec3..68dfc183 100644 --- a/hrp/pkg/uixt/video_crawler.go +++ b/hrp/pkg/uixt/video_crawler.go @@ -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() }