Skip to content

test: Redis driver conformance + benchmark vs go-redis #137

@FumingPower3925

Description

@FumingPower3925

Summary

Comprehensive conformance tests and performance benchmarks for the celeris Redis driver. Tests validate correctness against a real Redis instance. Benchmarks compare against go-redis (the most popular Go Redis client).

Conformance Tests

Connection

  • AUTH with password
  • SELECT database
  • Connection pooling behavior
  • Reconnection after connection drop

Commands

  • Strings: GET, SET, SETNX, DEL, EXISTS, INCR, DECR, EXPIRE, TTL, PERSIST
  • Hashes: HGET, HSET, HDEL, HGETALL, HEXISTS, HKEYS, HVALS
  • Lists: LPUSH, RPUSH, LPOP, RPOP, LRANGE, LLEN
  • Sets: SADD, SREM, SMEMBERS, SISMEMBER, SCARD, SUNION, SINTER
  • Sorted Sets: ZADD, ZRANGE, ZRANGEBYSCORE, ZREM, ZSCORE, ZCARD
  • Keys: TYPE, RENAME, RANDOMKEY, SCAN
  • NULL/nil responses for missing keys
  • Error responses for wrong-type operations

Pipeline

  • Batch 100+ commands
  • Correct response ordering
  • Error in middle of pipeline doesn't affect other commands
  • Nested pipeline (pipeline within pipeline)

Pub/Sub

  • Subscribe/unsubscribe single channel
  • Pattern subscribe
  • Message delivery latency
  • Reconnection with resubscription
  • Multiple subscribers on same channel

Pool

  • Worker affinity routing
  • Overflow to shared pool
  • MaxOpen enforcement
  • Idle connection cleanup
  • Concurrent access from multiple goroutines

Benchmarks

vs go-redis Comparison

BenchmarkGet/celeris
BenchmarkGet/go-redis
BenchmarkSet/celeris
BenchmarkSet/go-redis
BenchmarkPipeline100/celeris
BenchmarkPipeline100/go-redis
BenchmarkConcurrent/celeris
BenchmarkConcurrent/go-redis
BenchmarkPoolGetRelease/celeris
BenchmarkPoolGetRelease/go-redis

Metrics

  • Commands per second
  • Latency (p50, p99)
  • Memory allocations per command
  • Pipeline throughput (commands/sec)

Acceptance Criteria

  • All conformance tests pass against Redis 7+
  • Tests run in CI with Redis container
  • Benchmark suite comparing against go-redis
  • Zero-alloc on GET/SET hot path (verified by benchmarks)
  • Pool tests validate worker affinity
  • Pub/Sub tests verify message delivery

Dependencies

  • Depends on 133 (Redis client API)
  • Depends on 136 (Redis connection pool)

Metadata

Metadata

Labels

area/driverDatabase/cache driver infrastructurearea/testTesting infrastructuredriver/redisRedis driver

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions