Skip to content

[ISSUE #11339] test(filter): pin LogicExpression truth table and short-circuit - #11348

Open
chennaji9 wants to merge 1 commit into
apache:developfrom
chennaji9:cnj/test-logic-expression
Open

chennaji9 wants to merge 1 commit into
apache:developfrom
chennaji9:cnj/test-logic-expression

Conversation

@chennaji9

@chennaji9 chennaji9 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Which Issue(s) This PR Fixes

Fixes #11339

Brief Description

Adds a parameterized LogicExpressionTest pinning the SQL92 boolean logic every property-filter subscription compiles through:

  • the full 3x3 operand matrix (TRUE / FALSE / UNKNOWN) for both AND and OR, including UNKNOWN propagation (null AND TRUE = UNKNOWN, null OR FALSE = UNKNOWN);
  • matches() treats UNKNOWN as no-match;
  • short-circuit proofs using evaluation-counting operands: the right operand is provably not evaluated when FALSE AND … / TRUE OR … is already decided, and provably is evaluated otherwise.

Test-only change; no production code touched.

How Did You Test This Change?

mvn -pl filter -Dtest=LogicExpressionTest -Dsurefire.failIfNoSpecifiedTests=false test (JDK 11, PR base commit): Tests run: 54, Failures: 0, Errors: 0 (9 parameter combinations x 6 test methods).

…d short-circuit

Add parameterized LogicExpressionTest covering the full 3x3 TRUE/FALSE/
UNKNOWN matrix for AND and OR, the UNKNOWN-matches-false rule, and
short-circuit proofs via evaluation-counting operands.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.69%. Comparing base (9ea2ccd) to head (2615309).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #11348      +/-   ##
=============================================
- Coverage      49.73%   49.69%   -0.05%     
+ Complexity     14348    14340       -8     
=============================================
  Files           1390     1390              
  Lines         103246   103246              
  Branches       13502    13502              
=============================================
- Hits           51354    51310      -44     
- Misses         45696    45742      +46     
+ Partials        6196     6194       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review by github-manager-bot

Summary

Adds parameterized LogicExpressionTest pinning the SQL92 three-valued boolean logic truth tables and short-circuit behavior.

Findings

  • [Info] LogicExpressionTest.java — The 3x3 operand matrix (TRUE/FALSE/UNKNOWN) for both AND and OR is comprehensive. The Operand stub with evaluation counting is a clean way to verify short-circuit behavior.
  • [Info] The UNKNOWN-matches-false rule (matches() returns false for null) is correctly tested.

Suggestions

  • None. Well-structured parameterized tests that pin important semantic behavior.

Automated review by github-manager-bot

@RockteMQ-AI

Copy link
Copy Markdown
Contributor

Issue Evaluation

Category: type/enhancement | Status: Confirmed

The need for direct LogicExpression truth-table tests is valid. The SQL92 three-valued logic (TRUE/FALSE/UNKNOWN) used in property-filter subscriptions currently lacks explicit coverage for:

  • The full 3×3 operand matrix for AND and OR
  • UNKNOWN propagation semantics
  • Short-circuit evaluation guarantees

Impact: Without these tests, regressions in filter logic could silently change message routing behavior.
Severity: Medium (test gap in a correctness-critical path)

The proposed parameterized test approach (9 combinations × 6 methods = 54 test cases) provides comprehensive coverage. Test-only change with no production code impact.


Automated evaluation by github-manager-bot

@chennaji9
chennaji9 force-pushed the cnj/test-logic-expression branch from 2615309 to 905bb93 Compare October 18, 2026 08:11
@chennaji9

Copy link
Copy Markdown
Contributor Author

Hi @RongtongJin, sorry for the ping — this PR has been open for a while without a review yet. The change is small and focused (pin LogicExpression truth table and short-circuit), and all tests and CI pass on my side. Would you mind taking a look when you get a chance? If it looks good, merging it would be much appreciated — happy to adjust anything if needed. Thanks a lot!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] LogicExpression three-valued truth table and short-circuit behavior lack direct tests

3 participants