Skip to content

Commit f4f4668

Browse files
authored
chore: bump up max_busy_read_usec in tests (#5039)
cycle clock like most clocks is affected by thread context switching, and maybe this is what causes test failures. Try to increase the parameter to even further. Also, add benchmarks for the clock as well as fix some compiler warnings around parser.cc Signed-off-by: Roman Gershman <[email protected]>
1 parent 1082724 commit f4f4668

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

src/core/dfly_core_test.cc

+15
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,21 @@ static void BM_ParseDoubleAbsl(benchmark::State& state) {
223223
}
224224
BENCHMARK(BM_ParseDoubleAbsl);
225225

226+
template <clockid_t cid> void BM_ClockType(benchmark::State& state) {
227+
timespec ts;
228+
while (state.KeepRunning()) {
229+
DoNotOptimize(clock_gettime(cid, &ts));
230+
}
231+
}
232+
BENCHMARK_TEMPLATE(BM_ClockType, CLOCK_REALTIME);
233+
BENCHMARK_TEMPLATE(BM_ClockType, CLOCK_REALTIME_COARSE);
234+
BENCHMARK_TEMPLATE(BM_ClockType, CLOCK_MONOTONIC);
235+
BENCHMARK_TEMPLATE(BM_ClockType, CLOCK_MONOTONIC_COARSE);
236+
BENCHMARK_TEMPLATE(BM_ClockType, CLOCK_BOOTTIME);
237+
BENCHMARK_TEMPLATE(BM_ClockType, CLOCK_PROCESS_CPUTIME_ID);
238+
BENCHMARK_TEMPLATE(BM_ClockType, CLOCK_THREAD_CPUTIME_ID);
239+
BENCHMARK_TEMPLATE(BM_ClockType, CLOCK_BOOTTIME_ALARM);
240+
226241
static void BM_MatchGlob(benchmark::State& state) {
227242
string random_val = GetRandomHex(state.range(0));
228243
GlobMatcher matcher("*foobar*", true);

src/core/search/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ gen_bison(parser)
33

44
cur_gen_dir(gen_dir)
55

6+
set_source_files_properties(${gen_dir}/parser.cc PROPERTIES
7+
COMPILE_FLAGS "-Wno-maybe-uninitialized")
68
add_library(query_parser base.cc ast_expr.cc query_driver.cc search.cc indices.cc
79
sort_indices.cc vector_utils.cc compressed_sorted_set.cc block_list.cc
810
synonyms.cc ${gen_dir}/parser.cc ${gen_dir}/lexer.cc)

tests/dragonfly/connection_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ async def test_keyspace_events_config_set(async_client: aioredis.Redis):
525525
await collect_expiring_events(pclient, keys)
526526

527527

528-
@dfly_args({"max_busy_read_usec": 10000})
528+
@dfly_args({"max_busy_read_usec": 50000})
529529
async def test_reply_count(async_client: aioredis.Redis):
530530
"""Make sure reply aggregations reduce reply counts for common cases"""
531531

@@ -1122,7 +1122,7 @@ async def wait_for_stuck_on_send():
11221122

11231123

11241124
# Test that the cache pipeline does not grow or shrink under constant pipeline load.
1125-
@dfly_args({"proactor_threads": 1, "pipeline_squash": 9, "max_busy_read_usec": 10000})
1125+
@dfly_args({"proactor_threads": 1, "pipeline_squash": 9, "max_busy_read_usec": 50000})
11261126
async def test_pipeline_cache_only_async_squashed_dispatches(df_factory):
11271127
server = df_factory.create()
11281128
server.start()

0 commit comments

Comments
 (0)