This is an automated email from the ASF dual-hosted git repository.

xudong963 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 76ff87b132 Use the `test-threads` option in sqllogictests (#16722)
76ff87b132 is described below

commit 76ff87b132b62edac207bb1105836a52d32d269e
Author: Martin Garton <[email protected]>
AuthorDate: Thu Jul 10 02:37:50 2025 +0100

    Use the `test-threads` option in sqllogictests (#16722)
    
    Use the `test-threads` option in sqllogictests if it is passed in,
    instead of ignoring it.  Default to using get_available_parallelism as
    before otherwise.
    
    Previously, this option was only added for compatability with the
    standard test runner, but was ignored.
    
    ( This change was suggested by @alanb :
    https://github.com/apache/datafusion/pull/16694#discussion_r2190398395 )
---
 datafusion/sqllogictest/bin/sqllogictests.rs | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/datafusion/sqllogictest/bin/sqllogictests.rs 
b/datafusion/sqllogictest/bin/sqllogictests.rs
index eebd7bdf66..a4b85bdd1d 100644
--- a/datafusion/sqllogictest/bin/sqllogictests.rs
+++ b/datafusion/sqllogictest/bin/sqllogictests.rs
@@ -194,7 +194,7 @@ async fn run_tests() -> Result<()> {
             .join()
         })
         // run up to num_cpus streams in parallel
-        .buffer_unordered(get_available_parallelism())
+        .buffer_unordered(options.test_threads)
         .flat_map(|result| {
             // Filter out any Ok() leaving only the DataFusionErrors
             futures::stream::iter(match result {
@@ -692,9 +692,10 @@ struct Options {
 
     #[clap(
         long,
-        help = "IGNORED (for compatibility with built-in rust test runner)"
+        help = "Number of threads used for running tests in parallel",
+        default_value_t = get_available_parallelism()
     )]
-    test_threads: Option<usize>,
+    test_threads: usize,
 }
 
 impl Options {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to