Skip to content

Commit 908c2f2

Browse files
suzp1984winlinvip
andauthored
Fix hevc test failures (#4087)
Try to fix two blackbox test: 1. TestSlow_SrtPublish_HttpTsPlay_HEVC_Basic: fixed by enlarge the wait time from 3 seconds to 4 before run ffprobe task, which will record the stream by ffmpeg first. 2 TestSlow_SrtPublish_HlsPlay_HEVC_Basic: fixed by wait 16 seconds before run ffprobe task. About the 2 case: it seems ridiculous to add 16 seconds delay before run ffprobe task. > So, I start #4088 to check the github action workflow process, I start this branch from a very earlier version `6.0.113 (srs/core/srs_core_version6.hpp)`, what I found it that, inside `SRS blackbox-test`, the srs version `6.0.128`, the latest version, was printed. That's really wired. I confirmed this is not the SRS source code's problem, check https://github.com/suzp1984/srs/actions/runs/9511600525/job/26218025559 the srs code 6.0.113 was checkout and running actions based on them, still met same problem. --------- Co-authored-by: winlin <winlinvip@gmail.com>
1 parent 9dba99a commit 908c2f2

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

trunk/3rdparty/srs-bench/blackbox/hevc_test.go

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,14 @@ func TestSlow_SrtPublish_HttpTsPlay_HEVC_Basic(t *testing.T) {
900900
r1 = ffmpeg.Run(ctx, cancel)
901901
}()
902902

903+
// Should wait for TS to generate the contents.
904+
select {
905+
case <-ctx.Done():
906+
r2 = fmt.Errorf("timeout")
907+
return
908+
case <-time.After(5 * time.Second):
909+
}
910+
903911
// Start FFprobe to detect and verify stream.
904912
duration := time.Duration(*srsFFprobeDuration) * time.Millisecond
905913
ffprobe := NewFFprobe(func(v *ffprobeClient) {
@@ -912,9 +920,6 @@ func TestSlow_SrtPublish_HttpTsPlay_HEVC_Basic(t *testing.T) {
912920
defer wg.Done()
913921
<-svr.ReadyCtx().Done()
914922

915-
// wait for ffmpeg
916-
time.Sleep(3 * time.Second)
917-
918923
r2 = ffprobe.Run(ctx, cancel)
919924
}()
920925

@@ -949,7 +954,6 @@ func TestSlow_SrtPublish_HlsPlay_HEVC_Basic(t *testing.T) {
949954
// Setup the max timeout for this case.
950955
ctx, cancel := context.WithTimeout(logger.WithContext(context.Background()), time.Duration(*srsTimeout)*time.Millisecond)
951956
defer cancel()
952-
953957
// Check a set of errors.
954958
var r0, r1, r2, r3, r4 error
955959
defer func(ctx context.Context) {
@@ -995,12 +999,17 @@ func TestSlow_SrtPublish_HlsPlay_HEVC_Basic(t *testing.T) {
995999
defer wg.Done()
9961000
<-svr.ReadyCtx().Done()
9971001

998-
// wait for ffmpeg
999-
time.Sleep(3 * time.Second)
1000-
10011002
r1 = ffmpeg.Run(ctx, cancel)
10021003
}()
10031004

1005+
// Should wait for HLS to generate the ts files.
1006+
select {
1007+
case <-ctx.Done():
1008+
r2 = fmt.Errorf("timeout")
1009+
return
1010+
case <-time.After(20 * time.Second):
1011+
}
1012+
10041013
// Start FFprobe to detect and verify stream.
10051014
duration := time.Duration(*srsFFprobeDuration) * time.Millisecond
10061015
ffprobe := NewFFprobe(func(v *ffprobeClient) {

0 commit comments

Comments
 (0)