Skip to content

Test suite revamp#210

Open
mezis wants to merge 36 commits intojoyieldInc:masterfrom
fetlife:fix-tests
Open

Test suite revamp#210
mezis wants to merge 36 commits intojoyieldInc:masterfrom
fetlife:fix-tests

Conversation

@mezis
Copy link
Copy Markdown

@mezis mezis commented Jan 26, 2026

Introduces a comprehensive test harness for Predixy and fixes numerous bugs discovered through testing, focusing on Redis parity, thread-safety, and parser edge cases.

Key improvements:

  • Test infrastructure: Added Python-based test harness with 30+ test files covering basic operations, pub/sub, transactions, cross-shard operations, and edge cases
  • Pub/Sub fixes: Fixed message response handling, parser reset between messages, subscription confirmation ordering, and long channel name parsing
  • Thread-safety: Made Handler and Logger stop flags atomic, fixed signal handlers to be async-signal-safe
  • Parser hardening: Guarded against buffer underflows in error logging, handled boundary reads safely, prevented crashes on long commands
  • Multi-key command fixes: Preserve MGET error responses (WRONGTYPE), reject cross-shard MSETNX, validate EVAL keys are on one shard
  • Transaction handling: Keep connections open when transactions are forbidden, fix queuing behavior
  • Logger robustness: Handle vsnprintf errors, initialize thread pointer, cap log unit allocation
  • Build improvements: Added Docker build support, linting with Ruff and clang-tidy, new Make targets

mezis added 30 commits January 14, 2026 21:30
Attach parsed pubsub responses to SubMsg requests so message data is delivered.

Adds pubsub_message_response test and runs it in test harness.
Pause message queuing while subscriptions are pending to preserve confirmation ordering.

Adds pubsub_subscription_order test and includes it in the test runner.
Handle pubsub message replies immediately and reset the parser to avoid response reuse.

Adds pubsub_parser_reset test and runs it in the harness.
Convert unexpected null responses into DeliverRequestFail instead of crashing.

Adds null_response_handling test and runs it in the harness.
Extract subscription counts from the response tail to avoid truncation.

Adds pubsub_long_name test and runs it in the harness.
Return the error for forbidden commands in transactions without closing the client.

Adds transaction_forbid test and runs it in the harness.
Avoid coercing MGET errors into nil when aggregating responses.

Adds mget_wrong_type test and runs it in the harness.
Prevent MSETNX from being split across shards to preserve atomicity.

Adds msetnx_atomicity test and runs it in the harness.
Reject EVAL/EVALSHA when keys map to different hash groups.

Adds eval_cross_shard test and runs it in the harness.
Remove stray statements introduced during staging and normalize test runner order.
@mezis mezis changed the title Fix tests Test suite revamp Jan 26, 2026
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.

1 participant