-
Notifications
You must be signed in to change notification settings - Fork 469
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
Tests: No Cache Testing in ledger #5058
Conversation
7f1b4a8
to
074cac2
Compare
074cac2
to
4e2e30e
Compare
Codecov Report
@@ Coverage Diff @@
## master #5058 +/- ##
=======================================
Coverage 53.42% 53.42%
=======================================
Files 431 432 +1
Lines 54369 54412 +43
=======================================
+ Hits 29046 29071 +25
- Misses 23061 23079 +18
Partials 2262 2262
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
efbf2f1
to
1a8be94
Compare
356e757
to
c199c7f
Compare
fdc596e
to
4ef03ae
Compare
1ca465a
to
e3b026f
Compare
e3b026f
to
f5f2af3
Compare
ledger/acctupdates_test.go
Outdated
require.Equal(t, testcases[0].boxValue, val) | ||
addKV2AU(testcases[4].appID, testcases[4].boxKey, testcases[4].boxValue) | ||
_, err = readKey(testcases[0].appID, testcases[0].boxKey) | ||
require.NoError(t, err) |
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 the place that will hit error, for first box (testcase[0]
) goes into db after kvdelta:
- with LRU cache on, account-update reads from cache and still can get result, so it will not hit db read.
- otherwise, with nothing read from LRU cache and kvdelta, goes into DB and trigger panic.
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.
great. thanks for this sanity check.
…he test" This reverts commit f5f2af3.
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.
Had some minor comments, but I approve. Let me know when you want it merged.
Thanks for the previous approval @jannotti ! Let's see if I can get Chris approving it tomorrow, then we merge with 2 approvals. |
Summary
Had a discussion with Pavel on disabling ledger LRU cache for testing purpose, we settled down on following design/implementation:
DisableLedgerLRUCache
inLocal
(config/localTemplate.go)disableCache = cfg.DisableLedgerLRUCache
.!initializeFromDisk
, init lrukv/lruaccts/lruresources/lruOnlineAccounts withpendingWrite = 0
.pendingWrite == 0
, setdisableWrite*
to be True.disableWrite*
is True, then bypasses thewrite
operation, such that it never writes intokvs
(or map structure alike).Test Plan
Need to design on testcase to confirm that it works...