Commit 02dae77
authored
Speedup sqllogictests by running long running tests first (#20576)
## Which issue does this PR close?
- part of #20524
- Follow on to #20566 from
@kosiew
## Rationale for this change
Our sqllogictests harness runs the queries in a single file serially,
but runs multiple files in parallel
Right now, the runtime of
```shell
cargo test --profile=ci --test sqllogictests
```
Is domninated by a few long running tests -- so the sooner they are
started, the sooner the overall suite finishes
## What changes are included in this PR?
Bulding on #20566 from @kosiew
adds a heuristic reordering of the tests when run so that the longest
running are run first
## Are these changes tested?
By CI and I ran performance tests manually
### on main
On main this takes 8 seconds
```shell
andrewlamb@Andrews-MacBook-Pro-3:~/Software/datafusion$ cargo test --profile=ci --test sqllogictests
Finished `ci` profile [unoptimized] target(s) in 0.21s
Running bin/sqllogictests.rs (target/ci/deps/sqllogictests-c4e4be8d5c9fd66e)
Running with 16 test threads (available parallelism: 16)
Completed 408 test files in 8 seconds
```
## After test split
After #20566 it takes 7 seconds
to complete:
```shell
andrewlamb@Andrews-MacBook-Pro-3:~/Software/datafusion$ cargo test --profile=ci --test sqllogictests
Finished `ci` profile [unoptimized] target(s) in 0.20s
Running bin/sqllogictests.rs (target/ci/deps/sqllogictests-c4e4be8d5c9fd66e)
Running with 16 test threads (available parallelism: 16)
Completed 411 test files in 7 seconds
```
## This PR
With this PR it takes 5 seconds:
```shell
andrewlamb@Andrews-MacBook-Pro-3:~/Software/datafusion$ cargo test --profile=ci --test sqllogictests
Compiling datafusion-sqllogictest v52.1.0 (/Users/andrewlamb/Software/datafusion/datafusion/sqllogictest)
Finished `ci` profile [unoptimized] target(s) in 1.92s
Running bin/sqllogictests.rs (target/ci/deps/sqllogictests-c4e4be8d5c9fd66e)
Running with 16 test threads (available parallelism: 16)
Completed 411 test files in 5 seconds
```
This is actually bounded by the time it takes to run the longest test
`push_down_filter_regression.slt`:
```shell
andrewlamb@Andrews-MacBook-Pro-3:~/Software/datafusion$ cargo test --profile=ci --test sqllogictests -- push_down_filter_regression.slt
Finished `ci` profile [unoptimized] target(s) in 0.20s
Running bin/sqllogictests.rs (target/ci/deps/sqllogictests-c4e4be8d5c9fd66e)
Running with 16 test threads (available parallelism: 16)
Completed 1 test files in 5 seconds
```
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->1 parent 43584ca commit 02dae77
1 file changed
Lines changed: 68 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | | - | |
51 | 52 | | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
78 | 129 | | |
79 | 130 | | |
80 | 131 | | |
| |||
851 | 902 | | |
852 | 903 | | |
853 | 904 | | |
854 | | - | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
855 | 920 | | |
856 | 921 | | |
857 | 922 | | |
| |||
0 commit comments