Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

[RTC-230] Complete packet loss test #292

Merged
merged 5 commits into from
Jul 11, 2023
Merged

Conversation

sgfn
Copy link
Member

@sgfn sgfn commented Jul 5, 2023

This PR makes the test implemented in #280 actually compare the stats, as opposed to pass at all times ;)

@sgfn sgfn requested a review from mickel8 as a code owner July 5, 2023 12:41
@sgfn sgfn requested review from Rados13 and LVala July 5, 2023 12:45
Copy link
Member

@LVala LVala left a comment

Choose a reason for hiding this comment

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

I will be able to do the rest (not like I did much) of the review on Monday, but you don't have to wait if other reviews are finished earlier.

# The netem command will return an error when a container is stopped before the packet loss duration
# is up. This means we either need to kill it (and know when to do that), or ignore the error:
set +e

echo "Applying packet loss to $APPLY_LOSS_TO for $LOSS_DURATION seconds"
pumba netem \
Copy link
Member

Choose a reason for hiding this comment

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

Not necessarily connected to this PR, but it would be nice to check if pumba is available in PATH when starting the test (and kill the test if pumba fails). I've run it without it installed and it simply failed the tests with 1 line of log about that buried somewhere amongst the docker-compose logs.

Comment on lines +27 to +29
test "packet loss on one browser" do
TestVideoroom.Integration.ResultReceiver.start_link(browser_count: 3, parent: self())

Copy link
Member

Choose a reason for hiding this comment

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

I still think it would be nicer to have one Elixir node outside of the containers connected to them via distributed Erlang. You could move the logic responsible for testing outside of the mediaserver docker, get rid of the run_packet_loss_test.sh script and writing to file to enable packet loss hack and do everything from Elixir, also logs from test wouldn't be mixed with docker containers logs. It seems like it was decided to take care of this in later PR, but idk if this is the later PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

I completely agree, but that was outside the scope of this PR, and will have to be done in the future ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

That should be the next thing after this PR

@codecov
Copy link

codecov bot commented Jul 6, 2023

Codecov Report

Merging #292 (3360db6) into master (b15437f) will increase coverage by 0.14%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #292      +/-   ##
==========================================
+ Coverage   62.91%   63.05%   +0.14%     
==========================================
  Files          44       44              
  Lines        2130     2130              
==========================================
+ Hits         1340     1343       +3     
+ Misses        790      787       -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 b15437f...3360db6. Read the comment docs.

Comment on lines +76 to +78
if (ctx.track.kind === "video") {
this.peerIdToVideoTrack[ctx.endpoint.id] = ctx.track;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick but I feel like this could be in peers

Comment on lines +27 to +29
test "packet loss on one browser" do
TestVideoroom.Integration.ResultReceiver.start_link(browser_count: 3, parent: self())

Copy link
Contributor

Choose a reason for hiding this comment

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

That should be the next thing after this PR

@sgfn sgfn requested review from mickel8 and Rados13 July 6, 2023 13:15
@sgfn sgfn merged commit 7da831e into master Jul 11, 2023
@sgfn sgfn deleted the sgfn/RTC-230-simulate-net-condition branch July 11, 2023 08:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants