test: gossip_test: configure database memory allocation correctly

The memory configuration for the database object was left at zero.
This can cause the following chain of failures:
 - the test is a little slow due to the machine being overloaded,
   and debug mode
 - this causes the memtable flush_controller timer to fire before
   the test completes
 - the backlog computation callback is called
 - this calculates the backlog as dirty_memory / total_memory; this
   is 0.0/0.0, which resolves to NaN
 - eventually this gets converted to an integer
 - UBSAN dooesn't like the convertion from NaN to integer, and complains

Fix by initializing dbcfg.available_memory.

Test: gossip_test(debug), 1000 repetitions with concurrency 6

Closes #7544
This commit is contained in:
Avi Kivity
2020-11-03 19:53:51 +02:00
parent 1db9da2353
commit 8aa842614a

View File

@@ -47,6 +47,7 @@ SEASTAR_TEST_CASE(test_boot_shutdown){
return seastar::async([] {
distributed<database> db;
database_config dbcfg;
dbcfg.available_memory = memory::stats().total_memory();
auto cfg = std::make_unique<db::config>();
sharded<service::migration_notifier> mm_notif;
sharded<abort_source> abort_sources;