Skip to content

Commit c92df4f

Browse files
2010YOUY01Omega359
andauthored
Fix CI fail for extended test (by freeing up more disk space in CI runner) (#14745)
* Fix extended test * feedback * Update datafusion/core/tests/memory_limit/memory_limit_validation/sort_mem_validation.rs Co-authored-by: Bruce Ritchie <bruce.ritchie@veeva.com> * fix action version hash --------- Co-authored-by: Bruce Ritchie <bruce.ritchie@veeva.com>
1 parent 83487e3 commit c92df4f

File tree

2 files changed

+70
-32
lines changed

2 files changed

+70
-32
lines changed

.github/workflows/extended.yml

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,43 +39,54 @@ jobs:
3939
linux-build-lib:
4040
name: linux build test
4141
runs-on: ubuntu-latest
42-
container:
43-
image: amd64/rust
4442
steps:
4543
- uses: actions/checkout@v4
46-
- name: Setup Rust toolchain
47-
uses: ./.github/actions/setup-builder
4844
with:
49-
rust-version: stable
45+
submodules: true
46+
fetch-depth: 1
47+
- name: Install Rust
48+
run: |
49+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
50+
source $HOME/.cargo/env
51+
rustup default stable
52+
- name: Install Protobuf Compiler
53+
run: sudo apt-get install -y protobuf-compiler
5054
- name: Prepare cargo build
5155
run: |
5256
cargo check --profile ci --all-targets
5357
cargo clean
5458
55-
# # Run extended tests (with feature 'extended_tests')
56-
# # Disabling as it is running out of disk space
57-
# # see https://github.com/apache/datafusion/issues/14576
58-
# linux-test-extended:
59-
# name: cargo test 'extended_tests' (amd64)
60-
# needs: linux-build-lib
61-
# runs-on: ubuntu-latest
62-
# container:
63-
# image: amd64/rust
64-
# steps:
65-
# - uses: actions/checkout@v4
66-
# with:
67-
# submodules: true
68-
# fetch-depth: 1
69-
# - name: Setup Rust toolchain
70-
# uses: ./.github/actions/setup-builder
71-
# with:
72-
# rust-version: stable
73-
# - name: Run tests (excluding doctests)
74-
# run: cargo test --profile ci --exclude datafusion-examples --exclude datafusion-benchmarks --workspace --lib --tests --bins --features avro,json,backtrace,extended_tests
75-
# - name: Verify Working Directory Clean
76-
# run: git diff --exit-code
77-
# - name: Cleanup
78-
# run: cargo clean
59+
# Run extended tests (with feature 'extended_tests')
60+
linux-test-extended:
61+
name: cargo test 'extended_tests' (amd64)
62+
needs: linux-build-lib
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v4
66+
with:
67+
submodules: true
68+
fetch-depth: 1
69+
- name: Free Disk Space (Ubuntu)
70+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
71+
- name: Install Rust
72+
run: |
73+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
74+
source $HOME/.cargo/env
75+
rustup default stable
76+
- name: Install Protobuf Compiler
77+
run: sudo apt-get install -y protobuf-compiler
78+
# For debugging, test binaries can be large.
79+
- name: Show available disk space
80+
run: |
81+
df -h
82+
- name: Run tests (excluding doctests)
83+
env:
84+
RUST_BACKTRACE: 1
85+
run: cargo test --profile ci --exclude datafusion-examples --exclude datafusion-benchmarks --workspace --lib --tests --bins --features avro,json,backtrace,extended_tests
86+
- name: Verify Working Directory Clean
87+
run: git diff --exit-code
88+
- name: Cleanup
89+
run: cargo clean
7990

8091
# Check answers are correct when hash values collide
8192
hash-collisions:
@@ -95,7 +106,7 @@ jobs:
95106
- name: Run tests
96107
run: |
97108
cd datafusion
98-
cargo test --profile ci --exclude datafusion-examples --exclude datafusion-benchmarks --exclude datafusion-sqllogictest --workspace --lib --tests --features=force_hash_collisions,avro,extended_tests
109+
cargo test --profile ci --exclude datafusion-examples --exclude datafusion-benchmarks --exclude datafusion-sqllogictest --workspace --lib --tests --features=force_hash_collisions,avro
99110
cargo clean
100111
101112
sqllogictest-sqlite:

datafusion/core/tests/memory_limit/memory_limit_validation/sort_mem_validation.rs

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
//! This file is organized as:
2222
//! - Test runners that spawn individual test processes
2323
//! - Test cases that contain the actual validation logic
24-
use std::{process::Command, str};
25-
2624
use log::info;
25+
use std::sync::Once;
26+
use std::{process::Command, str};
2727

2828
use crate::memory_limit::memory_limit_validation::utils;
2929

30+
static INIT: Once = Once::new();
31+
3032
// ===========================================================================
3133
// Test runners:
3234
// Runners are splitted into multiple tests to run in parallel
@@ -67,10 +69,35 @@ fn sort_with_mem_limit_2_cols_2_runner() {
6769
spawn_test_process("sort_with_mem_limit_2_cols_2");
6870
}
6971

72+
/// `spawn_test_process` might trigger multiple recompilations and the test binary
73+
/// size might grow indefinitely. This initializer ensures recompilation is only done
74+
/// once and the target size is bounded.
75+
///
76+
/// TODO: This is a hack, can be cleaned up if we have a better way to let multiple
77+
/// test cases run in different processes (instead of different threads by default)
78+
fn init_once() {
79+
INIT.call_once(|| {
80+
let _ = Command::new("cargo")
81+
.arg("test")
82+
.arg("--no-run")
83+
.arg("--package")
84+
.arg("datafusion")
85+
.arg("--test")
86+
.arg("core_integration")
87+
.arg("--features")
88+
.arg("extended_tests")
89+
.env("DATAFUSION_TEST_MEM_LIMIT_VALIDATION", "1")
90+
.output()
91+
.expect("Failed to execute test command");
92+
});
93+
}
94+
7095
/// Helper function that executes a test in a separate process with the required environment
7196
/// variable set. Memory limit validation tasks need to measure memory resident set
7297
/// size (RSS), so they must run in a separate process.
7398
fn spawn_test_process(test: &str) {
99+
init_once();
100+
74101
let test_path = format!(
75102
"memory_limit::memory_limit_validation::sort_mem_validation::{}",
76103
test

0 commit comments

Comments
 (0)