From cfcfcbbb11675b7bf0ff5a15f0791845a81d2ea1 Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Tue, 21 Jan 2014 17:09:44 +0100
Subject: [PATCH] testnode: minimize writes to storage holding MySQL databases

---
 CHANGES.erp5.util.txt                 | 7 +++++++
 erp5/util/testnode/SlapOSControler.py | 8 ++++++++
 setup.py                              | 2 +-
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/CHANGES.erp5.util.txt b/CHANGES.erp5.util.txt
index 48963d2158..b8ba09195d 100644
--- a/CHANGES.erp5.util.txt
+++ b/CHANGES.erp5.util.txt
@@ -1,6 +1,13 @@
 Changes
 =======
 
+0.4.37 (2014-01-21)
+-------------------
+
+ * erp5.util.testnode:
+
+  - Minimize writes to storage holding MySQL databases.
+
 0.4.36 (2013-06-30)
 -------------------
 
diff --git a/erp5/util/testnode/SlapOSControler.py b/erp5/util/testnode/SlapOSControler.py
index 821613f7c7..e67d4f884e 100644
--- a/erp5/util/testnode/SlapOSControler.py
+++ b/erp5/util/testnode/SlapOSControler.py
@@ -34,6 +34,7 @@ import shutil
 import sys
 import glob
 import argparse
+import json
 from slapos import client
 
 MAX_PARTIONS = 10
@@ -357,6 +358,13 @@ class SlapOSControler(object):
     config['instance_dict']['report-url'] = config.get("report-url", "")
     config['instance_dict']['report-project'] = config.get("report-project", "")
     config['instance_dict']['suite-url'] = config.get("suite-url", "")
+    # XXX: Hack to minimize writes to storage holding MySQL databases.
+    #      Note this is something we want for all test suites, so it would
+    #      not be better to define this parameter on each test suite.
+    config['instance_dict']['_'] = json.dumps({"mariadb": {
+      "relaxed-writes": True,
+      "mariadb-relaxed-writes": True, # BBB
+      }})
     for path in self.software_path_list:
       try:
         self.slap.registerOpenOrder().request(path,
diff --git a/setup.py b/setup.py
index fb0f8d64c4..fa99271571 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
 import glob
 import os
 
-version = '0.4.36'
+version = '0.4.37'
 name = 'erp5.util'
 long_description = open("README.erp5.util.txt").read() + "\n"
 
-- 
2.30.9