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>
pull/3606/merge
Jacob Su 8 months ago committed by GitHub
parent 9dba99a1cc
commit 908c2f2a30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -900,6 +900,14 @@ func TestSlow_SrtPublish_HttpTsPlay_HEVC_Basic(t *testing.T) {
r1 = ffmpeg.Run(ctx, cancel) 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. // Start FFprobe to detect and verify stream.
duration := time.Duration(*srsFFprobeDuration) * time.Millisecond duration := time.Duration(*srsFFprobeDuration) * time.Millisecond
ffprobe := NewFFprobe(func(v *ffprobeClient) { ffprobe := NewFFprobe(func(v *ffprobeClient) {
@ -912,9 +920,6 @@ func TestSlow_SrtPublish_HttpTsPlay_HEVC_Basic(t *testing.T) {
defer wg.Done() defer wg.Done()
<-svr.ReadyCtx().Done() <-svr.ReadyCtx().Done()
// wait for ffmpeg
time.Sleep(3 * time.Second)
r2 = ffprobe.Run(ctx, cancel) r2 = ffprobe.Run(ctx, cancel)
}() }()
@ -949,7 +954,6 @@ func TestSlow_SrtPublish_HlsPlay_HEVC_Basic(t *testing.T) {
// Setup the max timeout for this case. // Setup the max timeout for this case.
ctx, cancel := context.WithTimeout(logger.WithContext(context.Background()), time.Duration(*srsTimeout)*time.Millisecond) ctx, cancel := context.WithTimeout(logger.WithContext(context.Background()), time.Duration(*srsTimeout)*time.Millisecond)
defer cancel() defer cancel()
// Check a set of errors. // Check a set of errors.
var r0, r1, r2, r3, r4 error var r0, r1, r2, r3, r4 error
defer func(ctx context.Context) { defer func(ctx context.Context) {
@ -995,12 +999,17 @@ func TestSlow_SrtPublish_HlsPlay_HEVC_Basic(t *testing.T) {
defer wg.Done() defer wg.Done()
<-svr.ReadyCtx().Done() <-svr.ReadyCtx().Done()
// wait for ffmpeg
time.Sleep(3 * time.Second)
r1 = ffmpeg.Run(ctx, cancel) 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. // Start FFprobe to detect and verify stream.
duration := time.Duration(*srsFFprobeDuration) * time.Millisecond duration := time.Duration(*srsFFprobeDuration) * time.Millisecond
ffprobe := NewFFprobe(func(v *ffprobeClient) { ffprobe := NewFFprobe(func(v *ffprobeClient) {

Loading…
Cancel
Save