Skip to content

Commit

Permalink
Refactor due to CR
Browse files Browse the repository at this point in the history
  • Loading branch information
FelonEkonom committed Mar 19, 2024
1 parent d1068aa commit bd5f8f3
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions test/membrane/integration/delayed_demands_loop_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,21 @@ defmodule Membrane.Test.DelayedDemandsLoopTest do
end

defp do_test(sinks_number) do
auto_demand_size = 20
auto_demand_size = 15

spec =
Stream.repeatedly(fn ->
get_child(:source)
|> via_in(:input, auto_demand_size: auto_demand_size)
|> child(Debug.Sink)
end)
|> Stream.take(sinks_number)
|> Enum.concat([child(:source, Source)])
[child(:source, Source)] ++
for i <- 1..sinks_number do
get_child(:source)
|> via_in(:input, auto_demand_size: auto_demand_size)
|> child({:sink, i}, Debug.Sink)
end

pipeline = Testing.Pipeline.start_link_supervised!(spec: spec)

Process.sleep(1_000)
for i <- 1..sinks_number do
assert_start_of_stream(pipeline, {:sink, ^i})
end

for _i <- 1..(auto_demand_size + 5) do
Testing.Pipeline.notify_child(pipeline, :source, :request)
Expand Down

0 comments on commit bd5f8f3

Please sign in to comment.