mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 16:02:10 +00:00
8eb36ce008
* 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>
22 lines
789 B
Rust
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)));
|
|
}
|