-
Notifications
You must be signed in to change notification settings - Fork 35
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
feat: add square wave latency summand #17
Conversation
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.
Thank you for taking the time to create this PR!
Changes look great. The only request I have regarding the code itself is related to the square wave formula. Also, would you mind adding the updated --help
output to README?
var conn *net.TCPConn | ||
|
||
// Wait for the speedbump instance to start listening | ||
// since it is started in a separate goroutine, we don't know | ||
// if it has already started listening by this point | ||
for { | ||
conn, err = net.DialTCP("tcp", nil, tcpAddr) | ||
if err != nil { | ||
time.Sleep(10 * time.Millisecond) | ||
} else { | ||
break | ||
} | ||
} |
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 test bug was causing the CI pipeline to fail every once in a while. Thanks for fixing it.
On a side note, it shows that the public API could be a bit more intuitive (i.e. Start()
that returns immediately after the proxy starts listening). Such changes will likely be introduced in v1 due to their breaking nature.
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.
LGTM, Thanks!
This PR adds a square wave latency summand. Since the
TestSpeedbumpWithEchoServer
was sometimes failing, I've also added a loop retrying TCP dials in case the proxy in a separate goroutine hasn't started listening yet.Resolves #16