Skip to content

Commit

Permalink
Fix tests wip
Browse files Browse the repository at this point in the history
  • Loading branch information
FelonEkonom committed Jan 16, 2024
1 parent b7e79b4 commit 3b9fdcb
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/membrane/integration/demands_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ defmodule Membrane.Integration.DemandsTest do

alias Membrane.Integration.DemandsTest.{PausingSink, RedemandingSource}

@tag :long_running
test "actions :pause_auto_demand and :resume_auto_demand" do
pipeline =
Testing.Pipeline.start_link_supervised!(
Expand All @@ -282,15 +281,15 @@ defmodule Membrane.Integration.DemandsTest do
assert_sink_playing(pipeline, :sink)

for i <- 1..10 do
# during sleep below source should send around 1000 buffers
Process.sleep(1000 * RedemandingSource.sleep_time())
# during sleep below source should send around 100 buffers
Process.sleep(100 * RedemandingSource.sleep_time())

Testing.Pipeline.execute_actions(pipeline, notify_child: {:sink, :pause_auto_demand})

assert_pipeline_notified(pipeline, :sink, {:buff_no, buff_no})
# sink should receive around 1000 buffers, but the boundary is set to 800, in case of eg.
# sink should receive around 100 buffers, but the boundary is set to 65, in case of eg.
# slowdown of the source when running all tests in the project asynchronously
if i != 1, do: assert(buff_no > 800)
if i != 1, do: assert(buff_no > 65)

# during sleep below source should send up to about auto_demand_size = 10 buffers
Process.sleep(100 * RedemandingSource.sleep_time())
Expand Down

0 comments on commit 3b9fdcb

Please sign in to comment.