Add MeaMod tests for Discover / Drop OSCQuery Services - #57
Add MeaMod tests for Discover / Drop OSCQuery Services#57momo-the-monster wants to merge 3 commits into
Conversation
| 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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.