Skip to content

Conversation

@mjgarton
Copy link
Contributor

@mjgarton mjgarton commented Jul 6, 2025

sqllogictests.rs already has various parts of it's Options struct that provide compatibility with the standard test running options.

Extend this to include the standard --test-threads option, so that running for example cargo test -- --test-threads 1 in the project root will succeed. Previously it complained about the unknown option.

This can be useful on a machine with a large number of cores which causes many tests to build & run in parallel, which in my case caused a crash due to exhausing the system RAM.

Fixes #16693

sqllogictests.rs already has various parts of it's Options struct that
provide compatibility with the standard test running options.

Extend this to include the standard `--test-threads` option, so that
running for example `cargo test -- --test-threads 1` in the project root
will succeed.  Previously it complained about the unknown option.

This can be useful on a machine with a large number of cores which causes
many tests to build & run in parallel, which in my case caused a crash
due to exhausing the system RAM.
@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Jul 6, 2025
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @mjgarton -- this makes sense to me

@alamb alamb changed the title Fix test running compatibility Fix sqllogictests test running compatibility (ignore --test-threads) Jul 7, 2025
Make test-threads optional, so that the tests also pass when this is not
passed in. 🤦
@alamb alamb merged commit 2afb681 into apache:main Jul 8, 2025
27 checks passed
@alamb
Copy link
Contributor

alamb commented Jul 8, 2025

Thanks again @mjgarton

mjgarton added a commit to mjgarton/datafusion that referenced this pull request Jul 9, 2025
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 :
apache#16694 (comment) )
@mjgarton mjgarton deleted the test_compatability branch July 9, 2025 12:14
xudong963 pushed a commit that referenced this pull request Jul 10, 2025
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 :
#16694 (comment) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running tests with --test-threads option fails.

2 participants