Repository: risingwavelabs/risingwave
File: src/meta/src/rpc/ddl_controller.rs (Rust)

Code before:
            true
        }
    });
}

#[cfg(test)]
mod tests {
    use std::num::NonZeroUsize;

    use super::*;

    #[test]
    fn specified_parallelism_can_exceed_available() {
        let result = DdlController::resolve_stream_parallelism_inner(
            Some(NonZeroUsize::new(100).unwrap()),
            NonZeroUsize::new(256).unwrap(),
            Some(NonZeroUsize::new(4).unwrap()),
            &DefaultParallelism::Full,
            "default",
        )
        .unwrap();
        assert_eq!(result.get(), 100);
    }

    #[test]
    fn default_parallelism_can_exceed_available() {
        let result = DdlController::resolve_stream_parallelism_inner(
            None,
            NonZeroUsize::new(256).unwrap(),
            Some(NonZeroUsize::new(4).unwrap()),
            &DefaultParallelism::Default(NonZeroUsize::new(50).unwrap()),
            "default",
        )
        .unwrap();
        assert_eq!(result.get(), 50);
    }

    #[test]
    fn full_parallelism_respects_max_parallelism_cap() {
        let result = DdlController::resolve_stream_parallelism_inner(
            None,
            NonZeroUsize::new(6).unwrap(),
            Some(NonZeroUsize::new(10).unwrap()),
            &DefaultParallelism::Full,
            "default",
        )
        .unwrap();
        assert_eq!(result.get(), 6);
    }

    #[test]

Review comment (suggestion):
[nitpick] Test name `default_parallelism_can_exceed_available` uses passive voice and doesn't clearly communicate what behavior is being tested. Consider renaming to `test_default_parallelism_exceeds_available_logs_warning` or `test_allows_default_parallelism_over_available` to better describe the expected behavior and follow common test naming conventions (starting with `test_`).
```suggestion
    fn test_allows_default_parallelism_over_available() {
```

Code after:
            true
        }
    });
}

#[cfg(test)]
mod tests {
    use std::num::NonZeroUsize;

    use super::*;

    #[test]
    fn test_specified_parallelism_exceeds_available() {
        let result = DdlController::resolve_stream_parallelism_inner(
            Some(NonZeroUsize::new(100).unwrap()),
            NonZeroUsize::new(256).unwrap(),
            Some(NonZeroUsize::new(4).unwrap()),
            &DefaultParallelism::Full,
            "default",
        )
        .unwrap();
        assert_eq!(result.get(), 100);
    }

    #[test]
    fn test_allows_default_parallelism_over_available() {
        let result = DdlController::resolve_stream_parallelism_inner(
            None,
            NonZeroUsize::new(256).unwrap(),
            Some(NonZeroUsize::new(4).unwrap()),
            &DefaultParallelism::Default(NonZeroUsize::new(50).unwrap()),
            "default",
        )
        .unwrap();
        assert_eq!(result.get(), 50);
    }

    #[test]
    fn test_full_parallelism_capped_by_max() {
        let result = DdlController::resolve_stream_parallelism_inner(
            None,
            NonZeroUsize::new(6).unwrap(),
            Some(NonZeroUsize::new(10).unwrap()),
            &DefaultParallelism::Full,
            "default",
        )
        .unwrap();
        assert_eq!(result.get(), 6);
    }

    #[test]