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

refactor: downsampling test #999

Merged

Conversation

YuanYuYuan
Copy link
Contributor

@YuanYuYuan YuanYuYuan commented Apr 30, 2024

This PR aims to make the test

  1. Less ambiguous by renaming "r100" to "10Hz" and "r50" to "20Hz".
  2. More deterministic. Previously, we began counting the message rate once the auxiliary keyexpr "all" received sufficient messages. However, the interaction between the normal flow and the downsampled flows is non-deterministic. Let's stick to the original meaning of "downsample the message flow" by measuring the number of messages per second. Furthermore, we can control the total test time and repeat the test specifically.

It also includes

  1. Better code reusability. For example, we could extend the rate_check in the future if more rigorous criteria are in demand. (Actually, a similar logic can apply to the other tests.)
  2. No mutex needed.
  3. Make the downsampling test run in parallel with the others as the issue of sleeping time has been resolved.

@YuanYuYuan
Copy link
Contributor Author

YuanYuYuan commented May 2, 2024

The stability test above seems good. @sashacmc can you please review this? Thanks.

Copy link
Member

@sashacmc sashacmc left a comment

Choose a reason for hiding this comment

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

Small note, others LGTM.
Thanks!

let rate_check = move |ke: KeyExpr, rate: usize| -> bool {
tracing::info!("keyexpr: {ke}, rate: {rate}");
if ke == ke_10hz {
rate > 0 && rate <= 10 + 1
Copy link
Member

Choose a reason for hiding this comment

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

Do we really still need this +1?
In the old test, this made it possible to cover fluctuations, but in theory they shouldn’t exist here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TBH, I don't want it as well. But we seem to need it based on the test results.

@Mallets Mallets merged commit e263d80 into eclipse-zenoh:main May 2, 2024
11 checks passed
@Mallets Mallets deleted the test/refine-downsampling-test branch May 2, 2024 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants