Skip to content

BYOC: Fix byoc whip ingest test#3860

Merged
ad-astra-video merged 1 commit intolivepeer:masterfrom
ad-astra-video:fix-byoc-whip-ingest-test
Jan 24, 2026
Merged

BYOC: Fix byoc whip ingest test#3860
ad-astra-video merged 1 commit intolivepeer:masterfrom
ad-astra-video:fix-byoc-whip-ingest-test

Conversation

@ad-astra-video
Copy link
Collaborator

What does this pull request do? Explain your changes. (required)

Fixes data race in TestStartStreamWhipIngestHandler

In the stack trace below, the updateStreamPipelineParams was doing a write when stream.streamParams.liveParams.segmentReader.Close() was being called. The updateStreamPipelineParams call in the test is not needed and not expected in regular code execution.

Removing this line and running five consecutive 200 count runs on the test showed no data race.

==================
WARNING: DATA RACE
Write at 0x00c0004f8350 by goroutine 319:
  github.com/livepeer/go-livepeer/byoc.(*BYOCGatewayServer).updateStreamPipelineParams()
      /home/runner/work/go-livepeer/go-livepeer/byoc/byoc.go:139 +0x184
  github.com/livepeer/go-livepeer/byoc.TestStartStreamWhipIngestHandler.func1()
      /home/runner/work/go-livepeer/go-livepeer/byoc/stream_test.go:1064 +0x11b9
  testing.tRunner()
      /opt/hostedtoolcache/go/1.25.0/x64/src/testing/testing.go:1934 +0x21c
  testing.testingSynctestTest.gowrap1()
      /opt/hostedtoolcache/go/1.25.0/x64/src/testing/testing.go:2046 +0x44

Previous read at 0x00c0004f8350 by goroutine 321:
  github.com/livepeer/go-livepeer/byoc.TestStartStreamWhipIngestHandler.func1.(*BYOCGatewayServer).StartStreamWhipIngest.1.2()
      /home/runner/work/go-livepeer/go-livepeer/byoc/stream_gateway.go:808 +0x464

Goroutine 319 (running) created at:
  testing/synctest.testingSynctestTest()
      /opt/hostedtoolcache/go/1.25.0/x64/src/testing/testing.go:2046 +0x5e7
  testing/synctest.Test.func1()
      /opt/hostedtoolcache/go/1.25.0/x64/src/testing/synctest/synctest.go:283 +0x44

Goroutine 321 (running) created at:
  github.com/livepeer/go-livepeer/byoc.TestStartStreamWhipIngestHandler.func1.(*BYOCGatewayServer).StartStreamWhipIngest.1()
      /home/runner/work/go-livepeer/go-livepeer/byoc/stream_gateway.go:797 +0x53d
  net/http.HandlerFunc.ServeHTTP()
      /opt/hostedtoolcache/go/1.25.0/x64/src/net/http/server.go:2322 +0xff0
  github.com/livepeer/go-livepeer/byoc.TestStartStreamWhipIngestHandler.func1()
      /home/runner/work/go-livepeer/go-livepeer/byoc/stream_test.go:1054 +0xfd4
  testing.tRunner()
      /opt/hostedtoolcache/go/1.25.0/x64/src/testing/testing.go:1934 +0x21c
  testing.testingSynctestTest.gowrap1()
      /opt/hostedtoolcache/go/1.25.0/x64/src/testing/testing.go:2046 +0x44
==================

Specific updates (required)

How did you test each of these updates (required)

Does this pull request close any open issues?

Checklist:

@github-actions github-actions bot added the go Pull requests that update Go code label Jan 24, 2026
@codecov
Copy link

codecov bot commented Jan 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 32.27106%. Comparing base (92bdb59) to head (6bf22c8).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #3860         +/-   ##
===================================================
+ Coverage   32.24436%   32.27106%   +0.02670%     
===================================================
  Files            169         169                 
  Lines          41201       41201                 
===================================================
+ Hits           13285       13296         +11     
+ Misses         26916       26902         -14     
- Partials        1000        1003          +3     

see 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92bdb59...6bf22c8. Read the comment docs.
see 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ad-astra-video ad-astra-video merged commit 1a26807 into livepeer:master Jan 24, 2026
18 of 19 checks passed
@ad-astra-video ad-astra-video deleted the fix-byoc-whip-ingest-test branch January 24, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants