Skip to content

Commit

Permalink
Re-enable test_e2e.sh in the CI pipeline (#2860)
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko authored Sep 19, 2023
1 parent aa81378 commit 25875a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ jobs:
PKG_CONFIG_PATH: "/home/runner/compiled/lib/pkgconfig"
run: |
./test.sh
./test_e2e.sh
- name: Upload coverage reports
uses: codecov/codecov-action@v3
Expand Down
22 changes: 6 additions & 16 deletions test/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func depositBroadcaster(t *testing.T, b *livepeer, amount *big.Int) {
require.Zero(info.Reserve.FundsRemaining.Cmp(amount))

// Ensure that on-chain deposit event handlers have time to process
time.Sleep(1 * time.Second)
time.Sleep(3 * time.Second)
}

func pushSegmentsBroadcaster(t *testing.T, b *livepeer, numSegs int) {
Expand All @@ -289,23 +289,13 @@ func pushSegmentsBroadcaster(t *testing.T, b *livepeer, numSegs int) {
mid := common.RandName()
for i := 0; i < numSegs; i++ {
require.Nil(pushSegmentBroadcaster(b, mid, i))
}
}

func pushSegmentsParallelBroadcaster(t *testing.T, b *livepeer, numSegs int) {
assert := assert.New(t)
// Wait at least 2 second between sending each segment to simulate the usual streaming scenario.
// In the Broadcaster's selection algorithm the Orchestrator's session is reused only if the previous
// segment is transcoded in a timely manner, so sending a new segment before the last one completed
// causes O's switch, which in turn causes the test failure (because we have only 1 O in this test).
time.Sleep(2 * time.Second)

var wg sync.WaitGroup
mid := common.RandName()
for i := 0; i < numSegs; i++ {
wg.Add(1)
go func(mid string, seqNo int) {
assert.Nil(pushSegmentBroadcaster(b, mid, i))
wg.Done()
}(mid, i)
}

wg.Wait()
}

func pushSegmentBroadcaster(b *livepeer, manifestID string, seqNo int) error {
Expand Down
3 changes: 0 additions & 3 deletions test/e2e/http_push_broadcaster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,4 @@ func TestHTTPPushBroadcaster(t *testing.T) {

// Sequential requests
pushSegmentsBroadcaster(t, b, 3)

// Parallel requests
pushSegmentsParallelBroadcaster(t, b, 5)
}

0 comments on commit 25875a3

Please sign in to comment.