alamb commented on code in PR #14142: URL: https://github.com/apache/datafusion/pull/14142#discussion_r1919192419
########## datafusion/core/tests/memory_limit/memory_limit_validation/sort_mem_validation.rs: ########## @@ -0,0 +1,201 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use std::process::Command; +use std::str; + +use log::info; + +use crate::memory_limit::memory_limit_validation::utils; + +/// Runner that executes each test in a separate process with the required environment +/// variable set. Memory limit validation tasks need to measure memory resident set +/// size (RSS), so they must run in a separate process. +#[test] Review Comment: This test takes more than 60 seconds on my laptop (which is longer than any othe rtest). Is there any way we can speed it up ``` SLOW [> 60.000s] datafusion::core_integration memory_limit::memory_limit_validation::sort_mem_validation::test_runner PASS [ 64.625s] datafusion::core_integration memory_limit::memory_limit_validation::sort_mem_validation::test_runner ``` I think it is because the subprocess is calling `cargo test` again (which is causing a recompile) ########## datafusion/core/tests/memory_limit/memory_limit_validation/sort_mem_validation.rs: ########## @@ -0,0 +1,201 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use std::process::Command; +use std::str; + +use log::info; + +use crate::memory_limit::memory_limit_validation::utils; + +/// Runner that executes each test in a separate process with the required environment +/// variable set. Memory limit validation tasks need to measure memory resident set +/// size (RSS), so they must run in a separate process. +#[test] +fn test_runner() { + let tests = vec![ + "memory_limit_validation_runner_works", + "sort_no_mem_limit", + "sort_with_mem_limit_1", + "sort_with_mem_limit_2", + "sort_with_mem_limit_3", + "sort_with_mem_limit_2_cols_1", + "sort_with_mem_limit_2_cols_2", + ]; + + let mut handles = vec![]; + + // Run tests in parallel, each test in a separate process Review Comment: I suggest we break these into their own tests (that each call a helper function) and leave the threading to the test runner (`cargo test` or `cargo nextest`) That makes: 1. The reporting better (the test runner prints out what tests are running) 2. Controls threads better (the user can control the runner) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org