-
Notifications
You must be signed in to change notification settings - Fork 881
chore: add README to clock testing #13583
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
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @spikecurtis and the rest of your teammates on |
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.
Some minor language nits, otherwise nice writeup!
clock/README.md
Outdated
* [github.com/aspenmesh/tock](https://github.com/aspenmesh/tock) | ||
|
||
Quartz shares the high level design of a `Clock` interface that closely resembles the functions in | ||
the `time` standard library, and a "real" clock passes thru to the standard libary in production, |
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.
the `time` standard library, and a "real" clock passes thru to the standard libary in production, | |
the `time` standard library, and a "real" clock passes through to the standard library in production, |
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.
clock/README.md
Outdated
Writing good unit tests for components and functions that use the `time` package is difficult, and | ||
several open source libraries exist. In building Quartz, we took some inspiration from |
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.
Writing good unit tests for components and functions that use the `time` package is difficult, and | |
several open source libraries exist. In building Quartz, we took some inspiration from | |
Writing good unit tests for components and functions that use the `time` package is difficult, even though | |
several open source libraries exist. In building Quartz, we took some inspiration from |
clock/README.md
Outdated
(As an aside, we still support a traditional standard library-style `Ticker`, if you want to keep | ||
your code as close as possible to the standard library, or if you need to use the channel in a | ||
larger `select` block, but in that case you'll have to find some other mechanism to sync tick | ||
processing to your test code.) |
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.
Run-on sentence, consider breaking up.
Our high level goal is to write unit tests that | ||
|
||
1. execute quickly | ||
2. don't flake |
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.
suggestion: avoid colloquialism
2. don't flake | |
2. execute reliably |
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.
While arguably "jargon", I think flaky is more precise. It refers to tests that succeed or fail due to uncontrolled randomness.
A test might not be reliable for other reasons, such as not actually testing or asserting the thing it purports to.
For several reasons, this is a tall order when it comes to code that depends on time, and we found | ||
the existing libraries insufficient for our goals. | ||
|
||
For tests to execute quickly without flakes, we want to focus on _determinism_: the test should run |
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.
For tests to execute quickly without flakes, we want to focus on _determinism_: the test should run | |
For tests to execute quickly and reliably, we want to focus on _determinism_: the test should run |
e4294f1
to
ba76a30
Compare
Adds README with some draft content explaining why the library exists. Will be most relevant when we spin out into a standalone library.