apalis-dev / apalis-dev/chirpy

feat (resp): Add integration tests for resp

Abierto
#4 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
4
Forks
2
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

# Integration Testing for RESP Server

## Overview
We need comprehensive integration tests for the RESP protocol server implementation to ensure all protocol commands work correctly in real-world scenarios with actual TCP connections.

## Background
Currently, the RESP server has unit tests, but we lack integration tests that validate the full client-server interaction over TCP. Integration tests will help us catch issues related to:
- Network communication and connection handling
- Protocol serialization/deserialization in real scenarios
- State management across multiple requests
- Concurrent client handling
- Edge cases and error conditions

## Goals
Create a robust integration test suite that:
1. Tests all RESP protocol commands end-to-end
2. Validates multi-client scenarios
3. Ensures proper connection lifecycle management
4. Verifies error handling and edge cases
5. Tests worker state transitions (Consumer → Quiet → Terminating)

## Test Scenarios to Cover

### Basic Protocol Flow
- [ ] Server startup and greeting (`HI` command)
- [ ] Client authentication (with and without password)
- [ ] Producer workflow: `HELLO` → `PUSH` → `END`
- [ ] Consumer workflow: `HELLO` → `FETCH` → `ACK` → `END`
- [ ] Consumer failure workflow: `HELLO` → `FETCH` → `FAIL` → `END`

### Job Lifecycle
- [ ] Push job and verify it's queued
- [ ] Fetch job from default queue
- [ ] Fetch job from specific named queues
- [ ] Fetch with multiple queue priority
- [ ] ACK job and verify removal
- [ ] FAIL job and verify retry scheduling
- [ ] Job with retry limit exhaustion (moves to dead)
- [ ] Scheduled jobs (with `at` field)
- [ ] Job reservation timeout and re-queueing

### Worker Management
- [ ] Worker registration via `HELLO`
- [ ] Worker heartbeat (`BEAT`) responses
- [ ] Worker state transitions (quiet, terminate)
- [ ] Multiple workers on same queue
- [ ] Worker disconnection cleanup

### Concurrency & Race Conditions
- [ ] Multiple producers pushing jobs simultaneously
- [ ] Multiple consumers fetching from same queue
- [ ] Job reservation conflicts
- [ ] Concurrent ACK/FAIL operations
- [ ] Worker registration race conditions

### Error Handling
- [ ] Invalid JSON in commands
- [ ] Missing required fields
- [ ] Commands in wrong state (e.g., FETCH before HELLO)
- [ ] Invalid job IDs in ACK/FAIL
- [ ] Protocol version mismatch
- [ ] Authentication failures
- [ ] Malformed RESP responses

### Administrative Commands
- [ ] `INFO` command and response parsing
- [ ] `FLUSH` command clears all jobs
- [ ] Graceful connection termination with `END`

### Edge Cases
- [ ] Empty queue fetch (should return null bulk string)
- [ ] Job with no retry (`retry: 0`)
- [ ] Job with infinite retry (`retry: -1`)
- [ ] Very long job arguments
- [ ] Unicode/special characters in job data
- [ ] Rapid connect/disconnect cycles
- [ ] Server under load (many concurrent connections)

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.