Skip to content

Conversation

@lucasbru
Copy link
Member

@lucasbru lucasbru commented Jun 23, 2025

It looks like we are checking for properties that are not guaranteed
under at_least_once, for example, exact counting (not allowing for
overcounting).

This change relaxes the validation constraint to only check that we
counted at least N messages, and our sums come out as at least the
expected sum.

Reviewers: Matthias J. Sax matthias@confluent.io

It looks like we are checking for properties that are not guaranteed under at_least_once, for example, exact counting (not allowing for overcounting).

This change relaxes the validation constraint to only check that we
we counted _at least_ N messages, and our sums come out as
_at least_ the expected sum.
@lucasbru lucasbru requested review from Copilot and mjsax and removed request for mjsax June 23, 2025 13:42
@github-actions github-actions bot added streams tests Test fixes (including flaky tests) small Small PRs labels Jun 23, 2025
@lucasbru lucasbru requested a review from bbejeck June 23, 2025 13:42
@lucasbru
Copy link
Member Author

PTAL @aliehsaeedii

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Relax the smoke test validation to only require at least the expected counts and sums under at-least-once semantics (non-EOS), while preserving exact validation for EOS.

  • Introduce a validationPredicate to switch between exact (equals) and at-least (>=) checks
  • Refactor all verify and verifyTAgg calls to accept the new predicate
  • Add lessEquals helper for the at-least-once comparison logic
Comments suppressed due to low confidence (3)

streams/src/test/java/org/apache/kafka/streams/tests/SmokeTestDriver.java:517

  • [nitpick] Consider renaming validationPredicate to something like comparisonPredicate or valueComparator to clarify that it encapsulates the comparison operation between expected and actual values.
        final BiPredicate<Number, Number> validationPredicate;

streams/src/test/java/org/apache/kafka/streams/tests/SmokeTestDriver.java:665

  • Add unit tests for the new at-least-once (lessEquals) predicate and the EOS vs non-EOS validation paths in both verifyTAgg and verify to ensure the new logic behaves as expected.
                                      final BiPredicate<Number, Number> validationPredicate,

lucasbru and others added 2 commits June 23, 2025 15:45
…Driver.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…Driver.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lucasbru lucasbru merged commit 4fedffd into apache:trunk Jun 23, 2025
23 checks passed
lucasbru added a commit that referenced this pull request Jun 23, 2025
It looks like we are checking for properties that are not guaranteed
under at_least_once, for example, exact counting (not allowing for
overcounting).

This change relaxes the validation constraint to only check that we
counted _at least_ N messages, and our sums come out as _at least_ the
expected sum.

Reviewers: Matthias J. Sax <matthias@confluent.io>
lucasbru added a commit to lucasbru/kafka that referenced this pull request Jun 24, 2025
It looks like we are checking for properties that are not guaranteed
under at_least_once, for example, exact counting (not allowing for
overcounting).

This change relaxes the validation constraint to only check that we
counted _at least_ N messages, and our sums come out as _at least_ the
expected sum.

Reviewers: Matthias J. Sax <matthias@confluent.io>
jiafu1115 pushed a commit to jiafu1115/kafka that referenced this pull request Jul 2, 2025
It looks like we are checking for properties that are not guaranteed
under at_least_once, for example, exact counting (not allowing for
overcounting).

This change relaxes the validation constraint to only check that we
counted _at least_ N messages, and our sums come out as _at least_ the
expected sum.

Reviewers: Matthias J. Sax <matthias@confluent.io>
jiafu1115 pushed a commit to jiafu1115/kafka that referenced this pull request Jul 3, 2025
It looks like we are checking for properties that are not guaranteed
under at_least_once, for example, exact counting (not allowing for
overcounting).

This change relaxes the validation constraint to only check that we
counted _at least_ N messages, and our sums come out as _at least_ the
expected sum.

Reviewers: Matthias J. Sax <matthias@confluent.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

small Small PRs streams tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants