KAFKA-20504: Update state wipe tests - #22959
Open
nicktelford wants to merge 1 commit into
Open
Conversation
Existing tests verifying state-wipe behaviour on dirty EOS close need to be scoped to the non-transactional case, since transactional state stores never let uncommitted writes reach the base store and so should not be wiped on error. Most of this was already covered by earlier KIP-892 work (StateManagerUtilTest, StandbyTaskTest, ProcessorStateManagerTest, and StandbyTaskEOSIntegrationTest already exercise both the transactional and non-transactional paths correctly). Two gaps remained. StreamTaskTest had a non-transactional active-task wipe test but no transactional counterpart (unlike its StandbyTaskTest sibling), so add shouldNotWipeStateDirectoryWhenCloseDirtyAndEosEnabledWithTransactionalStateStores mirroring the existing pattern. EOSUncleanShutdownIntegrationTest had no transactional coverage at all and mutated a shared static Properties field in place (a footgun once a second test method exists); refactor both tests to build their own Properties copy, make the existing test explicitly non-transactional, and add shouldNotWipeStateStoreOnUncleanShutdownWhenTransactional asserting the state directory survives an unclean shutdown when transactional stores are enabled. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
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.
Existing tests verifying state-wipe behaviour on dirty EOS close need to be scoped to the non-transactional case, since transactional state stores never let uncommitted writes reach the base store and so should not be wiped on error.
Most of this was already covered by earlier KIP-892 work —
StateManagerUtilTest,StandbyTaskTest,ProcessorStateManagerTest, andStandbyTaskEOSIntegrationTestalready exercise both the transactional and non-transactional paths correctly. Two gaps remained:StreamTaskTesthad a non-transactional active-task wipe test but no transactional counterpart (unlike itsStandbyTaskTestsibling), so this addsshouldNotWipeStateDirectoryWhenCloseDirtyAndEosEnabledWithTransactionalStateStoresmirroring the existing pattern.EOSUncleanShutdownIntegrationTesthad no transactional coverage at all, and mutated a shared staticPropertiesfield in place (a footgun once a second test method exists). This refactors both tests to build their ownPropertiescopy, makes the existing test explicitly non-transactional, and addsshouldNotWipeStateStoreOnUncleanShutdownWhenTransactionalasserting the state directory survives an unclean shutdown when transactional stores are enabled.