Files
windmill/backend/windmill-queue/tests/concurrency_limit_zero_test.rs
Ruben Fiszel 8eb36ce008 fix: treat concurrent_limit/timeout <= 0 as unset instead of a zero cap (#10288)
* fix: treat concurrent_limit/timeout <= 0 as unset instead of a zero cap

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix: flow-step timeout <= 0 inherits the script timeout, not the global default

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 19:05:09 +02:00

22 lines
789 B
Rust

//! Runtime gate for the `Some(0)` concurrency footgun: a stored `concurrent_limit <= 0`
//! must read as "disabled", never as a zero-slot cap that permanently blocks the job at the
//! concurrency gate (the re-queue storm the zombie monitor eventually fails as a fake OOM).
//!
//! Run with:
//! cargo test -p windmill-queue --test concurrency_limit_zero_test
use windmill_queue::jobs::has_active_concurrency_limit;
#[test]
fn zero_and_negative_are_not_active_limits() {
assert!(!has_active_concurrency_limit(None));
assert!(!has_active_concurrency_limit(Some(0)));
assert!(!has_active_concurrency_limit(Some(-1)));
}
#[test]
fn positive_limit_is_active() {
assert!(has_active_concurrency_limit(Some(1)));
assert!(has_active_concurrency_limit(Some(i32::MAX)));
}