-
Notifications
You must be signed in to change notification settings - Fork 238
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
Adhoc concurrent test for program cache #1471
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1471 +/- ##
========================================
Coverage 82.8% 82.8%
========================================
Files 872 872
Lines 369310 369435 +125
========================================
+ Hits 305846 306010 +164
+ Misses 63464 63425 -39 |
The codecov report shows the cookie line is now covered: https://app.codecov.io/gh/anza-xyz/agave/commit/c39034a846a71d58d25ac9751cf641b968b0187e/blob/svm/src/transaction_processor.rs#L454 |
} | ||
} | ||
|
||
fn deploy_program(name: String, mock_bank: &mut MockBankCallback) -> Pubkey { |
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 is probably the fourth or fifth time we implement a program load to deployment for tests method. Should be unified, but that can happen in a separate PR.
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 guess the issue is that all loading functions are under a #[cfg(test)]
flag, which makes them unavailable for import.
Problem
There are no concurrent tests for the program cache. We cover most lines in our testing, but the line that stops a thread on a condition variable has no testing coverage.
I noticed that this is the only place where there is an explicit wait/notify condition. In all other places in the program cache, we use mutexes and RWLocks, which are already covered in basic unit tests. Adding concurrent tests for them would only mean covering their blocking functionality.
Summary of Changes
I included an impromptu test to cover the cookie line in
replenish_program_cache
. The test is adhoc and is only a stop gap until I configure the repository to receive shuttle, which provides with mechanisms to manipulate thread scheduling and ensure correct multithreaded tests.