summaryrefslogtreecommitdiff
path: root/integrationtests/testhelpers.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-07-03 16:13:26 +0300
committerPaul Buetow <paul@buetow.org>2025-07-03 16:13:26 +0300
commitf1ae8e6eb80c8f2f4b4b18b5b93893ad3249c6a1 (patch)
treea9348d535148dae1a93f1b08e17d9870a30e7c75 /integrationtests/testhelpers.go
parenta4eb3cc769c13312fdd4b7aaa20659e408f734b7 (diff)
fix: implement thread-safe turbo mode for MapReduce operations
- Add SafeAggregateSet wrapper with mutex protection for concurrent access - Implement TurboAggregate for direct line processing without channels - Fix race conditions in turbo mode MapReduce aggregation - Add proper synchronization for batch processing completion - Update shutdown sequence to ensure all data is serialized - Add integration test configuration for high-concurrency scenarios The turbo mode now correctly handles MapReduce queries with significant performance improvements while maintaining data integrity and preventing race conditions during concurrent aggregation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'integrationtests/testhelpers.go')
-rw-r--r--integrationtests/testhelpers.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/integrationtests/testhelpers.go b/integrationtests/testhelpers.go
index a6a5f50..5368dfe 100644
--- a/integrationtests/testhelpers.go
+++ b/integrationtests/testhelpers.go
@@ -182,6 +182,16 @@ func createTestContextWithTimeout(t *testing.T) (context.Context, context.Cancel
return ctx, cancel
}
+// createTestContextWithLongTimeout creates a context with a 5-minute timeout for long-running tests
+func createTestContextWithLongTimeout(t *testing.T) (context.Context, context.CancelFunc) {
+ t.Helper()
+ ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
+ t.Cleanup(func() {
+ cancel()
+ })
+ return ctx, cancel
+}
+
// cleanupFiles registers files to be removed during test cleanup
func cleanupFiles(t *testing.T, files ...string) {
t.Helper()