#!/bin/bash

# Test script for concurrent DuckDB queries
# This script tests different configurations to find the best solution


echo "=== Test 1: Default configuration (concurrency=5, no delay) ==="
unset AZURE_READ_TRANSFER_CONCURRENCY
unset QUERY_START_DELAY_MS
./test_abfss_duckdb
echo ""

echo "=== Test 2: Lower concurrency (concurrency=1, no delay) ==="
export AZURE_READ_TRANSFER_CONCURRENCY=3
unset QUERY_START_DELAY_MS
./test_abfss_duckdb
echo ""

echo "=== Test 3: With start delay (concurrency=5, delay=1000ms) ==="
unset AZURE_READ_TRANSFER_CONCURRENCY
export QUERY_START_DELAY_MS=1000
./test_abfss_duckdb

echo "=== Test 4: Combined (concurrency=1, delay=1000ms) ==="
export AZURE_READ_TRANSFER_CONCURRENCY=1
export QUERY_START_DELAY_MS=2000
./test_abfss_duckdb
echo ""

echo "=== Test 5: Very low concurrency (concurrency=1, delay=5000ms) ==="
export AZURE_READ_TRANSFER_CONCURRENCY=1
export QUERY_START_DELAY_MS=5000
./test_abfss_duckdb
echo ""

echo "=== All tests completed ==="

