-
Notifications
You must be signed in to change notification settings - Fork 107
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 a test using its own executor (until the Kani library includes one) #1658
Conversation
} | ||
|
||
/// Adds a future to the scheduler's task list, returning a JoinHandle | ||
pub fn spawn<F: Future<Output = ()> + Sync + 'static>(&mut self, fut: F) -> JoinHandle { |
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.
What happens if you spawn
more than MAX_TASKS
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.
Make an explicit test
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'll add such a test to the libary PR, but since the number of tasks is always two in the test case in this file, I don't think this warrants the additional complexity.
|
||
#[kani::proof] | ||
#[kani::unwind(4)] | ||
fn deterministic_schedule() { |
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 name is surprising
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.
changed
} | ||
|
||
#[kani::proof] | ||
#[kani::unwind(4)] |
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.
How long does this take?
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.
About 15 seconds on my machine.
Approved modulo comments |
@danielsn Can you merge this please? |
This adds a test involving an executor written by the user. Long term, we want such an executor to be in the standard library but this is not currently possible because of linking issues.
Related issues:
Related: #1504
Testing:
How is this change tested? It's an added test
Is this a refactor change? No
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.