[profile.default]
# Run tests in parallel with optimal thread count
test-threads = "num-cpus"

# Show test output for failures
failure-output = "immediate-final"
success-output = "never"

# Fail loud in the inner loop; pass --retries 1 explicitly when chasing a flake
retries = 0

# Timeout settings
slow-timeout = { period = "30s", terminate-after = 1 }

[[profile.default.overrides]]
filter = 'binary(/^h3_/)'
test-group = 'h3-stateful'

[[profile.default.overrides]]
filter = 'binary(=validation_h2_streaming) | binary(=streaming_public_api) | binary(=h1_streaming)'
test-group = 'streaming-heavy'

[profile.ci]
# CI profile -- retry once to handle transient flakes
test-threads = 4
retries = 1
failure-output = "final"
success-output = "never"

# Keep collecting failures across worker-heavy CI runs
fail-fast = false
slow-timeout = { period = "30s", terminate-after = 1 }

[[profile.ci.overrides]]
filter = 'binary(/^h3_/)'
test-group = 'h3-stateful'

[[profile.ci.overrides]]
filter = 'binary(=validation_h2_streaming) | binary(=streaming_public_api) | binary(=h1_streaming)'
test-group = 'streaming-heavy'

[profile.pre-push]
# Pre-push profile - balance between speed and thoroughness
retries = 0
failure-output = "immediate"
success-output = "never"

# Don't fail fast to see all failures
fail-fast = false

# Shorter timeout for pre-push
slow-timeout = { period = "20s", terminate-after = 1 }

[[profile.pre-push.overrides]]
filter = 'binary(/^h3_/)'
test-group = 'h3-stateful'

[[profile.pre-push.overrides]]
filter = 'binary(=validation_h2_streaming) | binary(=streaming_public_api) | binary(=h1_streaming)'
test-group = 'streaming-heavy'

[test-groups]
h3-stateful = { max-threads = 2 }
streaming-heavy = { max-threads = 2 }
