Property-based testing framework for OpenSearch PPL (Piped Processing Language), using metamorphic relations to find correctness bugs.
Full documentation: docs/INDEX.md
# Test if known bugs are present in your OpenSearch instance
python test_bug_coverage.py --all
# Test specific bug categories
python test_bug_coverage.py --category arrays # Issue #5333
python test_bug_coverage.py --category nested # Issue #4906
python test_bug_coverage.py --category text-keyword # Issue #4463
python test_bug_coverage.py --category rename # Issue #5150See docs/BUG_HUNTING.md for details on what bugs are tested.
datagen/ - Generate test indices with schema and data
generators/ - PPL query generators (context-aware)
properties/ - Test properties (TLP, sorting, aggregation invariants, bug-specific tests)
runner/ - Execution engine and result validation
regression/ - Bug-specific test cases for known issues
Split queries by boolean predicate p:
source=index | where p | ...source=index | where not p | ...source=index | where isnull(p) | ...
Union should match unfiltered query.
stats count() by fieldtotal =stats count()stats sum(x)= sum ofstats sum(x) by groupfield- Monotonicity:
stats max(x)>=stats min(x)
sort fieldoutput must be orderedsort +field | head 1=stats max(field)sort -field | head 1=stats min(field)
Compare equivalent query forms:
where a=1 | where b=2vswhere a=1 and b=2eval x=a+b | where x>5vswhere a+b>5stats count() by a,bvs nested grouping
Tests that PPL command chains are truly additive:
- For any commands A and B:
source=index | A | Bshould equalmaterialize(source=index | A)thensource=materialized | B - Catches bugs where:
- Commands interact in unexpected ways
- Field references break across command boundaries
- Intermediate state isn't properly preserved
- Command B depends on original index structure rather than A's output
# Run specific property tests
python main.py --property tlp --iterations 100
python main.py --property atomic --iterations 100
python main.py --property additive-pipe --iterations 50
# Run all properties
python main.py --property all --iterations 100
# Test the additive pipe property specifically
python test_additive_pipe.pyCentralized registry in ppl_correctness/known_bugs.py tracks upstream bugs and skips affected test cases:
from ppl_correctness.known_bugs import should_skip, register_bug
from hypothesis import assume
# In property tests
skip_reason = should_skip(query=ppl_query, field=field_obj)
if skip_reason:
assume(False) # Hypothesis skips this case
# Register new bugs at runtime
register_bug('bug_name', 'Issue #1234: description',
lambda ctx: ctx.field.is_array)Current known bugs tracked in KNOWN_BUGS list with issue references.
- Python 3.11+
- opensearch-py
- hypothesis (property-based testing)