Skip to content

Commit

Permalink
Fix hevc test failures (#4087)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
suzp1984 and winlinvip authored Jun 14, 2024
1 parent 9dba99a commit 908c2f2
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions trunk/3rdparty/srs-bench/blackbox/hevc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,14 @@ func TestSlow_SrtPublish_HttpTsPlay_HEVC_Basic(t *testing.T) {
r1 = ffmpeg.Run(ctx, cancel)
}()

// Should wait for TS to generate the contents.
select {
case <-ctx.Done():
r2 = fmt.Errorf("timeout")
return
case <-time.After(5 * time.Second):
}

// Start FFprobe to detect and verify stream.
duration := time.Duration(*srsFFprobeDuration) * time.Millisecond
ffprobe := NewFFprobe(func(v *ffprobeClient) {
Expand All @@ -912,9 +920,6 @@ func TestSlow_SrtPublish_HttpTsPlay_HEVC_Basic(t *testing.T) {
defer wg.Done()
<-svr.ReadyCtx().Done()

// wait for ffmpeg
time.Sleep(3 * time.Second)

r2 = ffprobe.Run(ctx, cancel)
}()

Expand Down Expand Up @@ -949,7 +954,6 @@ func TestSlow_SrtPublish_HlsPlay_HEVC_Basic(t *testing.T) {
// Setup the max timeout for this case.
ctx, cancel := context.WithTimeout(logger.WithContext(context.Background()), time.Duration(*srsTimeout)*time.Millisecond)
defer cancel()

// Check a set of errors.
var r0, r1, r2, r3, r4 error
defer func(ctx context.Context) {
Expand Down Expand Up @@ -995,12 +999,17 @@ func TestSlow_SrtPublish_HlsPlay_HEVC_Basic(t *testing.T) {
defer wg.Done()
<-svr.ReadyCtx().Done()

// wait for ffmpeg
time.Sleep(3 * time.Second)

r1 = ffmpeg.Run(ctx, cancel)
}()

// Should wait for HLS to generate the ts files.
select {
case <-ctx.Done():
r2 = fmt.Errorf("timeout")
return
case <-time.After(20 * time.Second):
}

// Start FFprobe to detect and verify stream.
duration := time.Duration(*srsFFprobeDuration) * time.Millisecond
ffprobe := NewFFprobe(func(v *ffprobeClient) {
Expand Down

0 comments on commit 908c2f2

Please sign in to comment.