-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Unit tests for database shards #3332
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3332 +/- ##
===========================================
+ Coverage 70.22% 71.93% +1.70%
===========================================
Files 683 683
Lines 54621 54624 +3
===========================================
+ Hits 38360 39293 +933
+ Misses 16261 15331 -930
Continue to review full report at Codecov.
|
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.
Looks good to me.
The new test is now our longest running test by quite a margin. If there is any way to make the test run faster, I'd be in favor of that. However I wouldn't want to do that if it meant compromising the quality of the test. I took a look, and didn't see any obvious way to make the test run faster.
Travis CI now passing with updated time out value. |
@@ -232,7 +232,7 @@ class DatabaseShardImp : public DatabaseShard | |||
std::uint32_t ledgersPerShard_ = ledgersPerShardDefault; | |||
|
|||
// The earliest shard index | |||
std::uint32_t const earliestShardIndex_; | |||
std::uint32_t earliestShardIndex_; |
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.
It looks like you removed the const
qualifier in order to set earliestShardIndex_
in DatabaseShardImp::initConfig
. Why is that necessary when this variable gets initialized during the constructor?
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.
See previous comment.
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 understand why you did this - it's a consequence of the two phase initialization and testing. I'm OK with the change, but I'd add a comment explaining why this is not const.
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.
Do we need the travis.yml changes now the CI is fixed by Travis? Unless there is a reason I think we should not need these changes.
Done |
I reduced test time up to 5 times. |
static constexpr std::uint32_t dataSizeMax = 4; | ||
static constexpr std::uint32_t iniAmount = 1000000; | ||
static constexpr std::uint32_t nTestShards = 4; | ||
static constexpr std::uint32_t shardStoreTimeout = 60; |
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.
Consider using the std::chrono timing API: HowardHinnant@d43f168
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.
Done
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.
Please switch to chrono as recommended for DatabaseShard_test.cpp.
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.
Let mostly nits. Also agree with @HowardHinnant that chrono
would be a good change.
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.
Tested 6605e64
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.
👍
Depends on #3415 . |
This PR depends on PR 3415 being merged first. |
No description provided.