test: Add tests case when deltaMergeBySplit + { flushCache | split } occurs simultaneously (#5454) #5485
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an automated cherry-pick of #5454
What problem does this PR solve?
Issue Number: ref #5409
Problem Summary: For now we lack some tests to test the behavior when multiple operations occurred at the same time.
What is changed and how it works?
Introduced a new facility called
SyncPoint
, which can be used to control the arbitrary business logical flow to suspend and continue.Added or modified existing ManualCompaction tests based on the new
SyncPoint
:Modified: BasicManualCompactTest/DuplicatedLogicalId
Previously this test uses sleep(500ms) to expect specific code logic is finished. Now this sleep is substituted with SyncPoint, so that expected code logic is always finished and the test can continue without waiting for useless time.
Added: DeltaMergeStoreMergeDeltaBySegmentTest/RetryByFlushCache
Added: DeltaMergeStoreMergeDeltaBySegmentTest/RetryBySplit
The two new cases above tests whether everything works fine when there are mergeDeltaBySplit and flushCache (or split) happening simultaneously, based on the SyncPoint.
Added more guards in gtest_main:
Failures are now turned into exceptions by default, so that when writing ASSERT in sub-functions it will break the test immediately. This is particularly useful in SyncPoint tests, as when there are failures in previous sync point steps, it is very likely that the rest step will not work as expected, result in infinite wait. By turning into exceptions, we these test cases fail fast.
Added stack output when the program is unexpected terminated in fault signals like SIG_ABORT (and also
std::terminate
). This helps locate the code of triggering these faults.Check List
Tests
Side effects
Documentation
Release note