From 844d37c8cc454b8ca63d86c28593da22ebfd3840 Mon Sep 17 00:00:00 2001 From: Johannes Erdfelt Date: Wed, 26 Oct 2011 17:00:21 +0000 Subject: [PATCH] Disable SQLite synchronous mode during tests SQLite uses synchronous mode by default, which will synchronously write data to disk. This will increase durability of data at the expense of performance. The test suite does not need data to be durably written to disk, so disabling synchronous mode results in a speeding up the full test suite by about 20 seconds. Change-Id: I5ca1ab1e8691e912d801fe1002dff752c82f3d5d --- nova/flags.py | 1 + nova/tests/fake_flags.py | 1 + 2 files changed, 2 insertions(+) diff --git a/nova/flags.py b/nova/flags.py index 61f2288cf..da2cc9321 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -377,6 +377,7 @@ DEFINE_string('logdir', None, 'output to a per-service log file in named ' 'directory') DEFINE_string('logfile_mode', '0644', 'Default file mode of the logs.') DEFINE_string('sqlite_db', 'nova.sqlite', 'file name for sqlite') +DEFINE_bool('sqlite_synchronous', True, 'Synchronous mode for sqlite') DEFINE_string('sql_connection', 'sqlite:///$state_path/$sqlite_db', 'connection string for sql database') diff --git a/nova/tests/fake_flags.py b/nova/tests/fake_flags.py index 6c4de8481..13fb6c6ca 100644 --- a/nova/tests/fake_flags.py +++ b/nova/tests/fake_flags.py @@ -39,3 +39,4 @@ FLAGS['verbose'].SetDefault(True) FLAGS['sqlite_db'].SetDefault("tests.sqlite") FLAGS['use_ipv6'].SetDefault(True) FLAGS['flat_network_bridge'].SetDefault('br100') +FLAGS['sqlite_synchronous'].SetDefault(False)