-
Notifications
You must be signed in to change notification settings - Fork 8
Refactor Linux memory measurement tests #100
Conversation
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
"MemTotal: 16304208 kB\n" | ||
"MemFree: 827568 kB\n" | ||
"MemAvailable: 4838060 kB\n", | ||
ExpectedStatistics StatisticDataToExpectedStatistics(const StatisticData & src) |
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 can be moved to test_utilities
The continuous gtests exited with this failure:
|
Codecov Report
@@ Coverage Diff @@
## master #100 +/- ##
==========================================
+ Coverage 39.33% 39.36% +0.02%
==========================================
Files 36 36
Lines 1449 1481 +32
Branches 869 889 +20
==========================================
+ Hits 570 583 +13
- Misses 66 69 +3
- Partials 813 829 +16
Continue to review full report at Codecov.
|
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
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 seems good
ASSERT_EQ(State::PRIMARY_STATE_ACTIVE, test_measure_linux_memory_->get_current_state().id()); | ||
ASSERT_TRUE(test_measure_linux_memory_->IsStarted()); | ||
|
||
// |
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.
nit: extra comment line?
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.
Nice work with the PromiseSetter
approach.
Closes #96
This refactor uses futures in order to wait for asynchronous events, instead of making strict time assumptions. Note that the unit test no longer tests for multiple received messages, but this PR adds this check to e2e testing: #98
Marking as draft as test documentation is currently needed. Note that this test was run for >7000 times without failure using
./test_linux_memory_measurement_node --gtest_repeat=-1 --gtest_break_on_failure
.Signed-off-by: Devin Bonnie dbbonnie@amazon.com