Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure handle_demand busy wait infinite loop doesn't occur & deprecate message_child #779

Merged
merged 11 commits into from
Mar 20, 2024
6 changes: 5 additions & 1 deletion test/membrane/integration/delayed_demands_loop_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ defmodule Membrane.Test.DelayedDemandsLoopTest do
end

defp do_test(sinks_number) do
# auto_demand_size is smaller than delayed_demands_loop_counter_limit to ensure, that counter
# doesn't reset after calling handle_demand caused by reading positive atomic demand value
# during the snaphsot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# auto_demand_size is smaller than delayed_demands_loop_counter_limit to ensure, that counter
# doesn't reset after calling handle_demand caused by reading positive atomic demand value
# during the snaphsot
# auto_demand_size is smaller than delayed_demands_loop_counter_limit, to ensure that
# after calling handle_demand and making a snapshot, the atomic demand value is still positive
# and the counter is not reset

auto_demand_size = 15
requests_number = 20

spec =
[child(:source, Source)] ++
Expand All @@ -70,7 +74,7 @@ defmodule Membrane.Test.DelayedDemandsLoopTest do
assert_start_of_stream(pipeline, {:sink, ^i})
end

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