Add Neo4j integration tests and query rate-limiting logic
Some checks failed
Go / build-and-release (push) Has been cancelled

Introduce comprehensive integration tests for Neo4j bug fixes covering batching, event relationships, and processing logic. Add rate-limiting to Neo4j queries using semaphores and retry policies to prevent authentication rate limiting and connection exhaustion, ensuring system stability under load.
This commit is contained in:
2025-12-07 00:07:25 +00:00
parent 8ea91e39d8
commit 95271cbc81
21 changed files with 1925 additions and 1594 deletions

View File

@@ -69,13 +69,15 @@ func TestMain(m *testing.M) {
os.Exit(code)
}
// cleanTestDatabase removes all nodes and relationships
// cleanTestDatabase removes all nodes and relationships, then re-initializes
func cleanTestDatabase() {
ctx := context.Background()
// Delete all nodes and relationships
_, _ = testDB.ExecuteWrite(ctx, "MATCH (n) DETACH DELETE n", nil)
// Clear migration markers so migrations can run fresh
_, _ = testDB.ExecuteWrite(ctx, "MATCH (m:Migration) DELETE m", nil)
// Re-apply schema (constraints and indexes)
_ = testDB.applySchema(ctx)
// Re-initialize serial counter
_ = testDB.initSerialCounter()
}
// setupTestEvent creates a test event directly in Neo4j for testing queries