Implement generic tests for storage components#1718
Implement generic tests for storage components#1718fyrchik merged 10 commits intonspcc-dev:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1718 +/- ##
==========================================
+ Coverage 32.60% 33.13% +0.52%
==========================================
Files 338 350 +12
Lines 22820 23224 +404
==========================================
+ Hits 7441 7695 +254
- Misses 14754 14897 +143
- Partials 625 632 +7
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
Ready for review. Decided to postpone other points -- some of them require refactoring, others can affect stability, and the remaining need to be first discussed. I will create tasks. |
carpawell
left a comment
There was a problem hiding this comment.
if it is ready, change commit messages then?
| for i, component := range components { | ||
| if err := component.Open(false); err != nil { | ||
| if component == s.metaBase { | ||
| // We must first open all other components to avoid |
There was a problem hiding this comment.
can we simplify that code: just place meta in the first place? or you want to keep that info explicitly via the comment?
There was a problem hiding this comment.
We could, but first need to think whether it affects anything. Personally, I think the order doesn't matter in terms of readability, as in future we would like to handle e.g. write cache failures.
|
The interface doesn't allow this, and, as you noticed, the proper support has not yet been implemented. |
All components must be opened first, before any other operation is performed. Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
Use them for writecache as a simple example. Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
It is used only once, makes sense to inline. Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This tests check that each blobstor component behaves similarly when same methods are being used. It is intended to serve as a specification for all future components. Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
If the file doesn't exist, return `apistatus.ObjectNotFound`. First check is still there as a shortcut. Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This check should occur on the shard level, but because blobstor components expose `Open(readOnly bool)` interface, it is reasonable to expect an error here. Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
The blobovniczatree test also checks the amount of objects we can put, so leave it here. Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
DRAFT, TODO:
IgnoreErrorsflag for iteration over blobstor components.Rawflag toGetto return only raw data.Putfails for blobstor components in readonly, but Get succeeds.-raceflag.@carpawell @cthulhu-rider @realloc I feel like something is missing for
Open/SetMode/Closetests, may be you can suggest some other things that could possibly happen?