Skip to content

Commit 469e9cb

Browse files
pitrouwesm
authored andcommitted
ARROW-7552: [C++] [CI] Disable timing-sensitive tests on public CI
Closes #6173 from pitrou/ARROW-7552-disable-timing-tests and squashes the following commits: da2ccb2 <Antoine Pitrou> ARROW-7552: Disable timing-sensitive tests on public CI Authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Wes McKinney <[email protected]>
1 parent 78b54d9 commit 469e9cb

File tree

12 files changed

+40
-2
lines changed

12 files changed

+40
-2
lines changed

.github/workflows/cpp.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ on:
3030
- 'ci/**'
3131
- 'cpp/**'
3232

33+
env:
34+
ARROW_ENABLE_TIMING_TESTS: OFF
35+
3336
jobs:
3437

3538
conda:

.github/workflows/cpp_cron.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ on:
2929
- cron: |
3030
0 */12 * * *
3131
32+
env:
33+
ARROW_ENABLE_TIMING_TESTS: OFF
34+
3235
jobs:
3336

3437
debian:

ci/appveyor-cpp-build.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ if "%JOB%" == "Static_Crt_Build" (
4141
-DARROW_BUILD_TESTS=ON ^
4242
-DARROW_BUILD_EXAMPLES=ON ^
4343
-DCMAKE_BUILD_TYPE=Debug ^
44+
-DARROW_ENABLE_TIMING_TESTS=OFF ^
4445
-DARROW_TEST_LINKAGE=static ^
4546
-DARROW_CXXFLAGS="/MP" ^
4647
.. || exit /B
@@ -61,6 +62,7 @@ if "%JOB%" == "Static_Crt_Build" (
6162
-DARROW_BUILD_TESTS=ON ^
6263
-DARROW_BUILD_EXAMPLES=ON ^
6364
-DCMAKE_BUILD_TYPE=Release ^
65+
-DARROW_ENABLE_TIMING_TESTS=OFF ^
6466
-DARROW_TEST_LINKAGE=static ^
6567
-DCMAKE_CXX_FLAGS_RELEASE="/MT %CMAKE_CXX_FLAGS_RELEASE%" ^
6668
-DARROW_CXXFLAGS="/WX /MP" ^
@@ -90,6 +92,7 @@ if "%JOB%" == "Build_Debug" (
9092
-DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
9193
-DARROW_BUILD_STATIC=OFF ^
9294
-DARROW_CXXFLAGS="/MP" ^
95+
-DARROW_ENABLE_TIMING_TESTS=OFF ^
9396
.. || exit /B
9497

9598
cmake --build . --config %CONFIGURATION% || exit /B

ci/cpp-msvc-build-main.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@rem (i.e. for usual configurations)
2020

2121
set ARROW_HOME=%CONDA_PREFIX%\Library
22-
set CMAKE_ARGS=-DARROW_VERBOSE_THIRDPARTY_BUILD=OFF
22+
set CMAKE_ARGS=-DARROW_VERBOSE_THIRDPARTY_BUILD=OFF -DARROW_ENABLE_TIMING_TESTS=OFF
2323

2424
if "%JOB%" == "Toolchain" (
2525
set CMAKE_ARGS=^

ci/scripts/cpp_build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ cmake -G "${CMAKE_GENERATOR:-Ninja}" \
6060
-DARROW_DATASET=${ARROW_DATASET:-ON} \
6161
-DARROW_DEPENDENCY_SOURCE=${ARROW_DEPENDENCY_SOURCE:-AUTO} \
6262
-DARROW_EXTRA_ERROR_CONTEXT=${ARROW_EXTRA_ERROR_CONTEXT:-OFF} \
63+
-DARROW_ENABLE_TIMING_TESTS=${ARROW_ENABLE_TIMING_TESTS:-ON} \
6364
-DARROW_FILESYSTEM=${ARROW_FILESYSTEM:-ON} \
6465
-DARROW_FLIGHT=${ARROW_FLIGHT:-OFF} \
6566
-DARROW_FUZZING=${ARROW_FUZZING:-OFF} \

cpp/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ else()
322322
add_dependencies(unittest all-tests)
323323
endif()
324324

325+
if(ARROW_ENABLE_TIMING_TESTS)
326+
add_definitions(-DARROW_WITH_TIMING_TESTS)
327+
endif()
328+
325329
if(NOT ARROW_BUILD_BENCHMARKS)
326330
set(NO_BENCHMARKS 1)
327331
else()

cpp/cmake_modules/DefineOptions.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
113113

114114
define_option(ARROW_BUILD_TESTS "Build the Arrow googletest unit tests" OFF)
115115

116+
define_option(ARROW_ENABLE_TIMING_TESTS "Enable timing-sensitive tests" ON)
117+
116118
define_option(ARROW_BUILD_INTEGRATION "Build the Arrow integration test executables"
117119
OFF)
118120

cpp/src/arrow/flight/flight_test.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,11 @@ TEST_F(TestFlightClient, TimeoutFires) {
984984
auto start = std::chrono::system_clock::now();
985985
Status status = client->GetFlightInfo(options, FlightDescriptor{}, &info);
986986
auto end = std::chrono::system_clock::now();
987+
#ifdef ARROW_WITH_TIMING_TESTS
987988
EXPECT_LE(end - start, std::chrono::milliseconds{400});
989+
#else
990+
ARROW_UNUSED(end - start);
991+
#endif
988992
ASSERT_RAISES(IOError, status);
989993
}
990994

@@ -997,7 +1001,11 @@ TEST_F(TestFlightClient, NoTimeout) {
9971001
auto descriptor = FlightDescriptor::Path({"examples", "ints"});
9981002
Status status = client_->GetFlightInfo(options, descriptor, &info);
9991003
auto end = std::chrono::system_clock::now();
1004+
#ifdef ARROW_WITH_TIMING_TESTS
10001005
EXPECT_LE(end - start, std::chrono::milliseconds{600});
1006+
#else
1007+
ARROW_UNUSED(end - start);
1008+
#endif
10011009
ASSERT_OK(status);
10021010
ASSERT_NE(nullptr, info);
10031011
}

cpp/src/arrow/io/memory_test.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,12 @@ void TestSlowInputStream() {
305305
auto t2 = clock::now();
306306
AssertBufferEqual(*buf, "abcdef");
307307
auto dt = std::chrono::duration_cast<std::chrono::duration<double>>(t2 - t1).count();
308+
#ifdef ARROW_WITH_TIMING_TESTS
308309
ASSERT_LT(dt, latency * 3); // likely
309310
ASSERT_GT(dt, latency / 3); // likely
311+
#else
312+
ARROW_UNUSED(dt);
313+
#endif
310314

311315
ASSERT_OK_AND_ASSIGN(util::string_view view, slow->Peek(4));
312316
ASSERT_EQ(view, util::string_view("ghij"));

cpp/src/arrow/util/logging_test.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ TEST(PrintLogTest, LogTestWithInit) {
6868
ArrowLog::ShutDownArrowLog();
6969
}
7070

71+
#ifdef ARROW_WITH_TIMING_TESTS
72+
7173
// This test will output large amount of logs to stderr, should be disabled in travis.
7274
TEST(LogPerfTest, PerfTest) {
7375
ArrowLog::StartArrowLog("/fake/path/to/appdire/LogPerfTest", ArrowLogLevel::ARROW_ERROR,
@@ -103,6 +105,8 @@ TEST(LogPerfTest, PerfTest) {
103105
ArrowLog::ShutDownArrowLog();
104106
}
105107

108+
#endif
109+
106110
} // namespace util
107111

108112
TEST(DcheckMacros, DoNotEvaluateReleaseMode) {

cpp/src/arrow/util/macros.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
TypeName& operator=(TypeName&&) = default
3737
#endif
3838

39-
#define ARROW_UNUSED(x) (void)x
39+
#define ARROW_UNUSED(x) (void)(x)
4040
#define ARROW_ARG_UNUSED(x)
4141
//
4242
// GCC can be told that a certain branch is not likely to be taken (for

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ services:
8484
shm_size: &shm-size 2G
8585
environment:
8686
<<: *ccache
87+
ARROW_ENABLE_TIMING_TESTS: # inherit
8788
volumes: &conda-volumes
8889
- .:/arrow:delegated
8990
- ${ARCH}-conda-cache:/build:delegated
@@ -109,6 +110,7 @@ services:
109110
shm_size: *shm-size
110111
environment:
111112
<<: *ccache
113+
ARROW_ENABLE_TIMING_TESTS: # inherit
112114
volumes: &cuda-volumes
113115
- .:/arrow:delegated
114116
- ${ARCH}-cuda-${CUDA}-cache:/build:delegated
@@ -135,6 +137,7 @@ services:
135137
shm_size: *shm-size
136138
environment:
137139
<<: *ccache
140+
ARROW_ENABLE_TIMING_TESTS: # inherit
138141
volumes: &debian-volumes
139142
- .:/arrow:delegated
140143
- ${ARCH}-debian-${DEBIAN}-cache:/build:delegated
@@ -158,6 +161,7 @@ services:
158161
shm_size: *shm-size
159162
environment:
160163
<<: *ccache
164+
ARROW_ENABLE_TIMING_TESTS: # inherit
161165
volumes: &ubuntu-volumes
162166
- .:/arrow:delegated
163167
- ${ARCH}-ubuntu-${UBUNTU}-cache:/build:delegated
@@ -187,6 +191,7 @@ services:
187191
<<: *ccache
188192
CC: clang-7
189193
CXX: clang++-7
194+
ARROW_ENABLE_TIMING_TESTS: # inherit
190195
ARROW_JEMALLOC: "OFF"
191196
ARROW_ORC: "OFF"
192197
ARROW_USE_ASAN: "ON"
@@ -211,6 +216,7 @@ services:
211216
shm_size: *shm-size
212217
environment:
213218
<<: *ccache
219+
ARROW_ENABLE_TIMING_TESTS: # inherit
214220
volumes: &fedora-volumes
215221
- .:/arrow:delegated
216222
- ${ARCH}-fedora-${FEDORA}-cache:/build:delegated

0 commit comments

Comments
 (0)