You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 7, 2026. It is now read-only.
Create tests that inject failures during index building (KD-Tree, HNSW, Ball Tree)
Verify database remains in consistent state after failure
Test recovery mechanisms and partial index cleanup
Ensure search operations work with fallback to linear search
Validate database integrity after recovery
Failure Scenarios to Test
Out of Memory during HNSW build - Simulate memory exhaustion
Disk space exhaustion - Mock storage full during index save
Process termination - Interrupt index building mid-operation
Cancellation during async operations - Test proper cleanup
Concurrent modifications - Index building while vectors are being added
Test Structure
[Test][Category("Chaos")]publicasyncTaskDatabase_RecoverFromIndexBuildFailure_OutOfMemory(){// Arrange: Large dataset that could trigger memory issuesvardatabase=newVectorDatabase();PopulateWithLargeDataset(database,vectorCount:50000);// Act: Inject memory pressure during index buildusingvarmemoryPressure=newMemoryPressureSimulator();varexception=awaitAssert.ThrowsAsync<OutOfMemoryException>(()=>database.RebuildSearchIndexAsync(SearchAlgorithm.HNSW));// Assert: Database still functional with linear searchAssert.That(database.Count,Is.EqualTo(50000));varresults=database.Search(query,5,SearchAlgorithm.Linear);Assert.That(results.Count,Is.EqualTo(5));}
Mock Framework Integration
Create IFailureInjector interface for different failure types
Description
Test database behavior and recovery when index building is interrupted by failures like out-of-memory, disk space, or process termination.
Phase
Phase 1: Chaos Engineering and Failure Injection
Epic
Related to #202
Acceptance Criteria
Failure Scenarios to Test
Test Structure
Mock Framework Integration
IFailureInjectorinterface for different failure types