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

Add MeaMod tests for Discover / Drop OSCQuery Services #57

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

momo-the-monster
Copy link
Contributor

@momo-the-monster momo-the-monster commented Feb 26, 2024

Adds tests for MeaMod DNS to ensure it can discover an OSCQuery service and catch when it is un-advertised.

Uses some timeouts, which is not ideal but I haven't found another reliable approach.

@momo-the-monster momo-the-monster changed the title Feature/remove unadvertised services Add MeaMod tests for Discover / Drop OSCQuery Services Feb 26, 2024
advertiser.Advertise(oscQueryServiceProfile);
await Task.Delay(DELAY_TIME_MS); // Wait for the service to be advertised
discoverer.RefreshServices();
await Task.Delay(DELAY_TIME_MS); // Wait for the service to be discovered
Copy link
Contributor

Choose a reason for hiding this comment

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

can we not use the other side of MDNS here and just wait for a service to appear in the callback? We could kick it off as 2 tasks one which simply resolves after X maximum test timeout (e.g. 5 seconds) and the other as soon as the service is found?

Instead of just waiting a flat amount

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried that approach, making a TaskCancellationSource which resolves once the right service is found, or times out if it's not. It worked once and failed 5 times, whereas this approach worked every time for me. I don't love this approach, though.

I looked up the actual MeaMod Tests at the end of this weekend programming session - too late for another refactor on that day but probably worth investigating to see how they test things.

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.

2 participants