-
Notifications
You must be signed in to change notification settings - Fork 59
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 client function to return ping latency #201
Conversation
Nice idea. But I'd like a test. |
Added some tests, let me know if you'd like any changes :) |
client_test.go
Outdated
return diff | ||
}() | ||
|
||
if latencyDiff > time.Millisecond*3 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so flakey... I don't like this at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah true but I don't see an alternative, I was getting 0ms locally and it worked consistently, but when actions runs the test it fails. Do you have a better idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could try reverting the last 2 commits and using returnedLatency.Truncate
instead ofreturnedLatency.Round
, but even if that works now I'm not sure it won't eventually cause your tests to fail because actions ran too slowly.
Thanks for the contribution! |
Thought it would be useful to have a client function that returns ping latency like dank-twitch-irc does.