apalis-dev / apalis-dev/chirpy

feat (resp): Add integration tests for resp

Aberta
#4 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Rust
Estrelas
4
Forks
2
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

# 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)

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.