Skip to content

KAFKA-20504: Update state wipe tests - #22959

Open
nicktelford wants to merge 1 commit into
apache:trunkfrom
nicktelford:KIP-892/state-wipe-tests
Open

KAFKA-20504: Update state wipe tests#22959
nicktelford wants to merge 1 commit into
apache:trunkfrom
nicktelford:KIP-892/state-wipe-tests

Conversation

@nicktelford

Copy link
Copy Markdown
Contributor

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 this adds 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). This refactors both tests to build their own Properties copy, makes the existing test explicitly non-transactional, and adds shouldNotWipeStateStoreOnUncleanShutdownWhenTransactional asserting the state directory survives an unclean shutdown when transactional stores are enabled.

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>
@github-actions github-actions Bot added triage PRs from the community streams tests Test fixes (including flaky tests) labels Jul 27, 2026
@nicktelford

Copy link
Copy Markdown
Contributor Author

@bbejeck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

streams tests Test fixes (including flaky tests) triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant