-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Use BankForks on tests - Part 4 #34271
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #34271 +/- ##
=========================================
- Coverage 81.9% 81.9% -0.1%
=========================================
Files 819 819
Lines 220013 220120 +107
=========================================
+ Hits 180353 180400 +47
- Misses 39660 39720 +60 |
debug_assert!(self.fork_graph.is_some()); | ||
debug_assert_eq!( | ||
Some(working_slot.current_epoch()), | ||
self.fork_graph | ||
.as_ref() | ||
.unwrap() | ||
.read() | ||
.unwrap() | ||
.slot_epoch(working_slot.current_slot()) | ||
); |
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've added the assertions to ensure no other tests are created without BankForks
. Please, @pgarg66 let me know if I should remove them.
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.
We can remove the debug_assert_eq!
. Looks like with this PR all the tests are fixed up. In the next PR you can remove the WorkingSlot
, and just pass the current_slot as Slot
value.
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.
Should I keep the first debuf_assert
?
The second one ensures BankForks
is properly set on the tests, because we fetch the epoch from it.
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've remove the debug_assert_eq
.
Problem
In order for us to implement #34169 (remove
WorkSlot
fromLoadedPrograms::extract
), we need to make sure all tests create aBankFork
and use aBank
instance that has been added to the fork.Summary of Changes
This PR adds auxiliary functions to deal with
BankForks
and fixes tests inbench-tps
,ledger
,rpc
,stake-accounts
. This is the continuation of the work I started on #34238