diff --git a/testing/tests/benchmarks/conftest.py b/testing/tests/benchmarks/conftest.py
index 1b99d96ea7e2f93b864d3ea5c58a9f21bfaeb454..bec5d7abc0caee93c8ce75fcfdcf9043755fb031 100644
--- a/testing/tests/benchmarks/conftest.py
+++ b/testing/tests/benchmarks/conftest.py
@@ -1,6 +1,6 @@
+import base64
 import pytest
 import random
-import base64
 
 from twisted.internet import threads, reactor
 
diff --git a/testing/tests/conftest.py b/testing/tests/conftest.py
index 589cb7dee970f9fa17f0a4453860fb3ceb38535d..2459307afe1534c39826849f0070577c71dd82e5 100644
--- a/testing/tests/conftest.py
+++ b/testing/tests/conftest.py
@@ -3,6 +3,8 @@ import os
 import pytest
 import requests
 import signal
+import socket
+import sys
 import time
 
 from hashlib import sha512
@@ -215,3 +217,21 @@ def soledad_client(tmpdir, soledad_server, remote_db, soledad_dbs, request):
         request.addfinalizer(soledad_client.close)
         return soledad_client
     return create
+
+
+#
+# pytest-benchmark customizations
+#
+
+# avoid hooking if this is not a benchmarking environment
+if 'pytest_benchmark' in sys.modules:
+
+    def pytest_benchmark_update_machine_info(config, machine_info):
+        """
+        Add the host's hostname information to machine_info.
+
+        Get the value from the HOST_HOSTNAME environment variable if it is set,
+        or from the actual system's hostname otherwise.
+        """
+        hostname = os.environ.get('HOST_HOSTNAME', socket.gethostname())
+        machine_info['host'] = hostname
diff --git a/testing/tox.ini b/testing/tox.ini
index 0e4b2683262df043bf75971fbfa1795048b5a241..2acbf4fb430a5e6a1dc17040949a2b5f69e89281 100644
--- a/testing/tox.ini
+++ b/testing/tox.ini
@@ -64,10 +64,11 @@ install_command = pip3 install {opts} {packages}
 deps =
     {[testenv]deps}
     #pytest-benchmark>=3.1.0a2
-    git+https://github.com/drebs/pytest-benchmark.git@use-netrc-file
+    git+https://github.com/drebs/pytest-benchmark.git@fix-update-machine-info-hook-spec
     elasticsearch
     certifi
 commands = py.test --benchmark-only {posargs}
+passenv = HOST_HOSTNAME
 
 [testenv:code-check]
 changedir = ..