test(lola): verify skeleton event timestamp after reopen#408
Open
rudresh-systream wants to merge 4 commits into
Open
test(lola): verify skeleton event timestamp after reopen#408rudresh-systream wants to merge 4 commits into
rudresh-systream wants to merge 4 commits into
Conversation
Signed-off-by: Rudresh Shirwal <rudresh.shirwal@systream.io>
crimson11
requested changes
May 19, 2026
| << "The second timestamp should be exactly one greater than the first."; | ||
| } | ||
|
|
||
| TEST_F(SkeletonEventTimestampFixture, PrepareOfferInitializesCurrentTimestampFromReopenedControlData) |
Contributor
There was a problem hiding this comment.
Please add the "Given/Expect that/when/then" comments like in the other test cases. Makes reading/understanding the test so much clearer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Add a test that check that current_timestamp_ is set correctly.
It should be possible to inject your own EventDataControl which has some preset slot values using ExpectControlSegmentOpened() in the SkeletonMockedMemoryFixture.
How
No response
Estimates for realization
Effort low
No impact on users expected
Category
Affects Detailed Design
Summary:
This PR addresses issue #87: “Add unit test in skeleton_event.h for checking timestamp”.
The ticket asks for unit-test coverage to verify that current_timestamp_ is set correctly. The important scenario is not only the normal Send() path, but also the reopened/shared-memory path where existing EventDataControl already contains preset slot timestamp values. The test validates that SkeletonEvent correctly continues the timestamp sequence from the existing slot data.
link: #87
Changes made:
Updated:
score/mw/com/impl/bindings/lola/skeleton_event_test.cpp
Added a new unit test:
SkeletonEventTimestampFixture.PrepareOfferInitializesCurrentTimestampFromReopenedControlData
This test:
Updated:
score/mw/com/impl/bindings/lola/test/skeleton_test_resources.h
Added helper declarations:
Updated:
score/mw/com/impl/bindings/lola/test/skeleton_test_resources.cpp
Added helper implementations to allow SkeletonMockedMemoryFixture tests to inject existing control/data shared-memory objects instead of always creating fresh memory objects.
Why the changes were made:
The existing timestamp coverage only checked normal timestamp incrementing during Send(). That proves the fresh/default case, but it does not prove the ticket requirement: that current_timestamp_ is initialized correctly when existing EventDataControl with preset slot values is reopened.
This new test covers the intended partial-restart/reopen scenario. If the existing shared-memory slot has timestamp 42, the next sent event must use timestamp 43. This verifies that timestamp continuity is preserved.
Alternatives considered:
Test only normal Send() timestamp increments.
Directly expose or read current_timestamp_ using friend access or an attorney helper.
Verify behavior through externally observable timestamp output after injecting preset control data.
Build and test results:
The focused unit test was executed with:
bazel test //score/mw/com/impl/bindings/lola:skeleton_event_test
--test_filter=SkeletonEventTimestampFixture.PrepareOfferInitializesCurrentTimestampFromReopenedControlData
--test_output=all
Result:
The LoLa package build was executed with:
bazel build //score/mw/com/impl/bindings/lola:all
Result:
The wider LoLa test suite was executed with:
bazel test //score/mw/com/impl/bindings/lola/... --test_output=errors
Result:
The wider COM test command was also run:
bazel test //score/mw/com/... --test_output=errors
Result:
Verification:
The new test verifies the required timestamp behavior by setting an existing slot timestamp to 42 and confirming that the next sent sample receives timestamp 43 after PrepareOffer(). This confirms that SkeletonEvent initializes/continues current_timestamp_ correctly from reopened EventDataControl state.
Branch used:
feature/87-skeleton-event-current-timestamp
Linked issue:
Closes #87