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

Compute client waiting time without including testing framework time #50

Closed
wants to merge 1 commit into from

Conversation

wilcoxjay
Copy link
Contributor

Previously, the time to stop node threads and the time to check invariants was charged against any outstanding client requests' waiting time. Stopping a node thread requires that the node thread finish executing the current event handler. If the event handler has a performance bug, that will cause runstate.stop() to be slow. Similarly, checking invariants can be expensive for long logs.

This commit introduces markEndTimeOfOutstandingRequest, which allows the test to set the ending time of outstanding requests before stopping threads and checking invariants. Then, after those (potentially expensive) operations, the tests can assert that the waiting time is acceptable.

Unfortunately this introduces a bit of a sharp corner into the testing framework's internal API: it would be easy to forget to call markEndTimeOfOutstandingRequest before assertMaxWaitTimeLessThan. Perhaps we should add a check for this to help with framework maintenance.

I also added a warning if the framework detects that runstate.stop() took longer than one second. That indicates that some event handler in the system took a long time to run. (This warning remains difficult to debug, but at least the new situation is better than the previous one.)

Previously, the time to stop node threads and the time to check
invariants was charged against any outstanding client requests'
waiting time. Stopping a node thread requires that the node thread
finish executing the current event handler. If the event handler has a
performance bug, that will cause `runstate.stop()` to be slow.
Similarly, checking invariants can be expensive for long logs.

This commit introduces markEndTimeOfOutstandingRequest, which allows
the test to set the ending time of outstanding requests *before*
stopping threads and checking invariants. Then, after
those (potentially expensive) operations, the tests can assert that
the waiting time is acceptable.

Unfortunately this introduces a bit of a sharp corner into the testing
framework's internal API: it would be easy to forget to call
markEndTimeOfOutstandingRequest before assertMaxWaitTimeLessThan.
Perhaps we should add a check for this to help with framework
maintenance.

I also added a warning if the framework detects that `runstate.stop()`
took longer than one second. That indicates that some event handler in
the system took a long time to run. (This warning remains difficult to
debug, but at least the new situation is better than the previous one.)
@wilcoxjay
Copy link
Contributor Author

Fixes #48

@emichael
Copy link
Owner

Closing in favor of #54.

@emichael emichael closed this Jul 11, 2023
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