-
Notifications
You must be signed in to change notification settings - Fork 12
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 several new tests #1
base: main
Are you sure you want to change the base?
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.
Maybe a few lines of code should be corrected
src/porcupine/utils.rs
Outdated
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.
Is this module translated from Golang code? It seems like a double linked list.
There is too much unsafe code here. Maybe we should figure out how to write in safe code if possible. 🤔
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.
Yes, this algorithm was translated from Golang. Most of the unsafe codes were introduced by NonNull
, so I wrapped them in a new type. 🤔
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 linked list is totally safe now. 🤔
src/kvraft/tester.rs
Outdated
lazy_static! { | ||
static ref T0: Instant = Instant::now(); | ||
} |
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 looks weird, although I understand it's a workaround for getting current timestamp.
In madsim v0.2 we could use std::time::SystemTime
directly to get timestamp of the simulated time.
But it's another long story to upgrade madsim to v0.2...
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.
Seems there's a lot of work upgrading madsim...🥲 Now I removed the lazy_static
stuff and used t0
in Tester
as a start timestamp.
refactor: remove timeout, use Result as return value in porcupine
This PR includes some new tests and a tool to check linearizability.