Repository: smarr/ReBench (language: python)

Issue:
Reenable testing on PyPy on GitHub Actions once the PyYAML issue is resolved
Currently, PyYAML can't be installed on PyPy on GitHub Actions.

See https://github.com/smarr/ReBench/actions/runs/5578565182/jobs/10192946324

Because of this, I am going to disable testing on it. But this should be reverted this is fixed.
Also, it worked earlier today, but the GHA versions don't seem to show any change...

```
× Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [54 lines of output]
      running egg_info
      writing lib/PyYAML.egg-info/PKG-INFO
      writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
      writing top-level names to lib/PyYAML.egg-info/top_level.txt
      Traceback (most recent call last):
        File "/opt/hostedtoolcache/PyPy/3.10.12/x64/lib/pypy3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/hostedtoolcache/PyPy/3.10.12/x64/lib/pypy3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/hostedtoolcache/PyPy/3.10.12/x64/lib/pypy3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line [28](https://github.com/smarr/ReBench/actions/runs/5578565182/jobs/10192946324#step:7:29)8, in <module>
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/command/egg_info.py", line [31](https://github.com/smarr/ReBench/actions/runs/5578565182/jobs/10192946324#step:7:32)4, in run
          self.find_sources()
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/command/egg_info.py", line [32](https://github.com/smarr/ReBench/actions/runs/5578565182/jobs/10192946324#step:7:33)2, in find_sources
          mm.run()
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/command/egg_info.py", line 551, in run
          self.add_defaults()
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/command/egg_info.py", line 589, in add_defaults
          sdist.add_defaults(self)
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/command/sdist.py", line 104, in add_defaults
          super().add_defaults()
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
          self._add_defaults_ext()
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/_distutils/command/sdist.py", line [33](https://github.com/smarr/ReBench/actions/runs/5578565182/jobs/10192946324#step:7:34)6, in _add_defaults_ext
          self.filelist.extend(build_ext.get_source_files())
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<string>", line 204, in get_source_files
        File "/tmp/pip-build-env-0h7xx5ej/overlay/lib/pypy3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
          raise AttributeError(attr)
      AttributeError: cython_sources
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
```


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1446eba4..97cdaf7e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -3,12 +3,14 @@ name: CI
 on: [push, pull_request]
 
 jobs:
-  build:
+  test-linux:
     runs-on: ubuntu-latest
     strategy:
       fail-fast: false
       matrix:
-        python-version: [ '3.7', '3.11', 'pypy3.9' ]
+        # Don't test pypy3.10, it currently is broken on GitHub Actions.
+        # re-enable once PyYAML can be installed again. See #225
+        python-version: [ '3.7', '3.11' ]  # 'pypy3.10'
         yaml-parser: ['', 'ruamel']
         include:
           - python-version: 3.7
@@ -16,9 +18,9 @@ jobs:
         exclude:
           - python-version: 3.11
             yaml-parser: ruamel
-          - python-version: pypy3
+          - python-version: pypy3.10
             yaml-parser: ruamel
-    name: Python ${{ matrix.python-version }} ${{ matrix.yaml-parser }}
+    name: "Ubuntu-latest: Python ${{ matrix.python-version }} ${{ matrix.yaml-parser }}"
     steps:
       - name: Checkout ReBench
         uses: actions/checkout@v3
@@ -60,8 +62,31 @@ jobs:
           COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
         if: ${{ matrix.coverage && env.COVERALLS_REPO_TOKEN != '' }}
 
+  test-macos:
+    runs-on: macos-latest
+    name: "macOS: Python 3.11"
+    steps:
+      - name: Checkout ReBench
+        uses: actions/checkout@v3
+
+      - name: Setup Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: "3.11"
+
+      - name: Install PyTest
+        run: pip install pytest
+
+      - name: Install ReBench dependencies
+        run: pip install .
+
+      - name: Run tests
+        run: |
+          python -m pytest
+          (cd rebench && rebench ../rebench.conf e:TestRunner2)
+
   test-docker:
-    name: Test ReBench in Docker
+    name: "Docker: python:3"
     runs-on: ubuntu-latest
     container:
       image: python:3
@@ -70,9 +95,6 @@ jobs:
       - name: Check for dockerenv file
         run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv)
 
-      - name: Make Python to be Python3
-        run: ln -s /usr/bin/python3 /usr/bin/python && ln -s /usr/bin/pip3 /usr/bin/pip
-
       - name: Install Time Command
         run: |
           apt-get update
@@ -82,13 +104,13 @@ jobs:
         uses: actions/checkout@v3
 
       - name: Install PyTest
-        run: pip install pytest
+        run: pip3 install pytest
 
       - name: Install ReBench dependencies
-        run: pip install .
+        run: pip3 install .
 
       - name: Run Test Run
         run: (cd rebench && rebench -D ../rebench.conf e:TestRunner2)
 
       - name: Run Unit Tests
-        run: python -m pytest
+        run: python3 -m pytest
diff --git a/rebench/denoise.py b/rebench/denoise.py
index 8b8cae21..7bbdb047 100644
--- a/rebench/denoise.py
+++ b/rebench/denoise.py
@@ -1,5 +1,3 @@
-from __future__ import print_function
-
 import getpass
 import json
 import os
diff --git a/rebench/executor.py b/rebench/executor.py
index a6cb5fb6..2ac71634 100644
--- a/rebench/executor.py
+++ b/rebench/executor.py
@@ -17,8 +17,6 @@
 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 # THE SOFTWARE.
-from __future__ import with_statement
-
 from codecs import open as open_with_enc
 from collections import deque
 from math import floor
diff --git a/rebench/rebench.py b/rebench/rebench.py
index 0c6b1b6b..b80a56dd 100755
--- a/rebench/rebench.py
+++ b/rebench/rebench.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # ReBench is a tool to run and document benchmarks.
 #
 # It is inspired by JavaStats implemented by Andy Georges.
diff --git a/rebench/reporter.py b/rebench/reporter.py
index 8b53a1bb..c3d2749d 100644
--- a/rebench/reporter.py
+++ b/rebench/reporter.py
@@ -17,8 +17,6 @@
 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 # THE SOFTWARE.
-from __future__ import with_statement
-
 from time import time
 from operator import itemgetter
 import json
diff --git a/rebench/subprocess_with_timeout.py b/rebench/subprocess_with_timeout.py
index e344326e..c70ed1be 100644
--- a/rebench/subprocess_with_timeout.py
+++ b/rebench/subprocess_with_timeout.py
@@ -1,5 +1,3 @@
-from __future__ import print_function
-
 from select     import select
 from subprocess import PIPE, STDOUT, Popen
 from threading  import Thread, Condition
diff --git a/setup.py b/setup.py
index 5fe9ef73..70830e61 100644
--- a/setup.py
+++ b/setup.py
@@ -38,11 +38,11 @@
       packages=find_packages(exclude=['*.tests']),
       package_data={'rebench': ['rebench-schema.yml']},
       install_requires=[
-          'PyYAML>=3.12',
+          'PyYAML>=6.0',
           'pykwalify>=1.8.0',
-          'humanfriendly>=8.0',
+          'humanfriendly>=10.0',
           'py-cpuinfo==9.0.0',
-          'psutil>=5.6.7'
+          'psutil>=5.9.5'
       ],
       entry_points = {
           'console_scripts' : [


Test patch:
diff --git a/rebench/tests/bugs/issue_111_vm.py b/rebench/tests/bugs/issue_111_vm.py
index c9e990cf..7724e1b5 100755
--- a/rebench/tests/bugs/issue_111_vm.py
+++ b/rebench/tests/bugs/issue_111_vm.py
@@ -1,7 +1,5 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # simple script emulating a failing benchmark
-from __future__ import print_function
-
 print("Bench: iterations=1 runtime: 1000ms")
 print("Bench: iterations=1 runtime: 1000ms")
 print("Bench: iterations=1 runtime: 10ms")
diff --git a/rebench/tests/bugs/issue_27_vm.py b/rebench/tests/bugs/issue_27_vm.py
index 2701cd61..d8d9abc8 100755
--- a/rebench/tests/bugs/issue_27_vm.py
+++ b/rebench/tests/bugs/issue_27_vm.py
@@ -1,6 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # simple script emulating a failing benchmark
-from __future__ import print_function
-
 print("Starting Richards benchmark ...")
 print("Results are incorrect")
diff --git a/rebench/tests/bugs/vm-one-result.py b/rebench/tests/bugs/vm-one-result.py
index 8a3fc82c..4266bff7 100755
--- a/rebench/tests/bugs/vm-one-result.py
+++ b/rebench/tests/bugs/vm-one-result.py
@@ -1,7 +1,5 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # simple script emulating an executor generating benchmark results
-from __future__ import print_function
-
 import sys
 import random
 
diff --git a/rebench/tests/environment_test.py b/rebench/tests/environment_test.py
index 5d476385..b93ef7b4 100644
--- a/rebench/tests/environment_test.py
+++ b/rebench/tests/environment_test.py
@@ -34,7 +34,7 @@ def test_environment(self):
 
         self.assertTrue('manualRun' in env)
         self.assertGreater(env['memory'], 0)
-        self.assertGreater(env['clockSpeed'], 0)
+        self.assertGreaterEqual(env['clockSpeed'], 0)
 
         self.assertGreaterEqual(len(env['software']), 3)
 
diff --git a/rebench/tests/features/ignore_timeouts_vm.py b/rebench/tests/features/ignore_timeouts_vm.py
index 6d59351f..57173ed8 100755
--- a/rebench/tests/features/ignore_timeouts_vm.py
+++ b/rebench/tests/features/ignore_timeouts_vm.py
@@ -1,7 +1,5 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # simple script emulating an executor generating benchmark results
-from __future__ import print_function
-
 import sys
 import random
 from time import sleep
diff --git a/rebench/tests/features/issue_15_vm.py b/rebench/tests/features/issue_15_vm.py
index 6cdf1345..4dc6bcd3 100755
--- a/rebench/tests/features/issue_15_vm.py
+++ b/rebench/tests/features/issue_15_vm.py
@@ -1,7 +1,5 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # simple script emulating an executor generating benchmark results
-from __future__ import print_function
-
 import sys
 import random
 
diff --git a/rebench/tests/features/issue_16_vm.py b/rebench/tests/features/issue_16_vm.py
index 9fb2d7bc..f4968556 100755
--- a/rebench/tests/features/issue_16_vm.py
+++ b/rebench/tests/features/issue_16_vm.py
@@ -1,7 +1,5 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # simple script emulating an executor generating benchmark results
-from __future__ import print_function
-
 import sys
 
 print(sys.argv)
diff --git a/rebench/tests/features/issue_19_one_data_point_test.py b/rebench/tests/features/issue_19_one_data_point_test.py
index df94b2ec..75978cd7 100644
--- a/rebench/tests/features/issue_19_one_data_point_test.py
+++ b/rebench/tests/features/issue_19_one_data_point_test.py
@@ -17,8 +17,6 @@
 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
-from __future__ import print_function
-
 from ...configurator     import Configurator, load_config
 from ...executor         import Executor, RoundRobinScheduler
 from ...persistence      import DataStore
diff --git a/rebench/tests/features/issue_19_vm.py b/rebench/tests/features/issue_19_vm.py
index 013cf5de..302a92eb 100755
--- a/rebench/tests/features/issue_19_vm.py
+++ b/rebench/tests/features/issue_19_vm.py
@@ -1,7 +1,5 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # simple script emulating an executor generating benchmark results
-from __future__ import print_function
-
 import sys
 import random
 
diff --git a/rebench/tests/features/issue_31_multivariate_data_points_test.py b/rebench/tests/features/issue_31_multivariate_data_points_test.py
index bf682c85..df1d8d24 100644
--- a/rebench/tests/features/issue_31_multivariate_data_points_test.py
+++ b/rebench/tests/features/issue_31_multivariate_data_points_test.py
@@ -17,8 +17,6 @@
 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
-from __future__ import print_function
-
 from ...configurator           import Configurator, load_config
 from ...executor               import Executor
 from ...persistence            import DataStore
diff --git a/rebench/tests/features/issue_31_vm.py b/rebench/tests/features/issue_31_vm.py
index d275f4b1..b41a3db2 100755
--- a/rebench/tests/features/issue_31_vm.py
+++ b/rebench/tests/features/issue_31_vm.py
@@ -1,7 +1,5 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # simple script emulating an executor generating benchmark results
-from __future__ import print_function
-
 import sys
 
 print(sys.argv)
diff --git a/rebench/tests/features/issue_34_vm.py b/rebench/tests/features/issue_34_vm.py
index b9ad484b..fc5254c5 100755
--- a/rebench/tests/features/issue_34_vm.py
+++ b/rebench/tests/features/issue_34_vm.py
@@ -1,6 +1,4 @@
-#!/usr/bin/env python
-from __future__ import print_function
-
+#!/usr/bin/env python3
 import sys
 
 print(sys.argv)
diff --git a/rebench/tests/features/issue_42_test.py b/rebench/tests/features/issue_42_test.py
index b7e7e55d..ee3004da 100644
--- a/rebench/tests/features/issue_42_test.py
+++ b/rebench/tests/features/issue_42_test.py
@@ -17,7 +17,6 @@
 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
-from __future__ import print_function
 import os
 import unittest
 from unittest import skip
diff --git a/rebench/tests/features/issue_42_vm.py b/rebench/tests/features/issue_42_vm.py
index 6d3b29af..3407638c 100755
--- a/rebench/tests/features/issue_42_vm.py
+++ b/rebench/tests/features/issue_42_vm.py
@@ -1,7 +1,5 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # simple script emulating an executor generating benchmark results
-from __future__ import print_function
-
 import random
 import os
 import sys
@@ -14,7 +12,8 @@
 print(env)
 
 known_envvars = ["PWD", "SHLVL", "VERSIONER_PYTHON_VERSION",
-                 "_", "__CF_USER_TEXT_ENCODING", "LC_CTYPE"]
+                 "_", "__CF_USER_TEXT_ENCODING", "LC_CTYPE",
+                 "CPATH", "LIBRARY_PATH", "MANPATH", "SDKROOT"]
 
 if test == "as-expected":
     if os.environ.get("IMPORTANT_ENV_VARIABLE", None) != "exists":
diff --git a/rebench/tests/features/issue_58_build_vm_test.py b/rebench/tests/features/issue_58_build_vm_test.py
index 8ec6604d..6fa368e4 100644
--- a/rebench/tests/features/issue_58_build_vm_test.py
+++ b/rebench/tests/features/issue_58_build_vm_test.py
@@ -17,7 +17,6 @@
 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
-from __future__ import print_function
 import os
 
 from ...configurator     import Configurator, load_config
diff --git a/rebench/tests/features/issue_59_build_suite_test.py b/rebench/tests/features/issue_59_build_suite_test.py
index 5ee6d554..8120502f 100644
--- a/rebench/tests/features/issue_59_build_suite_test.py
+++ b/rebench/tests/features/issue_59_build_suite_test.py
@@ -17,7 +17,6 @@
 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
-from __future__ import print_function
 import os
 
 from ...configurator     import Configurator, load_config
diff --git a/rebench/tests/features/issue_81_unicode_test.py b/rebench/tests/features/issue_81_unicode_test.py
index 243bed75..7d92d579 100644
--- a/rebench/tests/features/issue_81_unicode_test.py
+++ b/rebench/tests/features/issue_81_unicode_test.py
@@ -17,7 +17,6 @@
 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
-from __future__ import print_function
 import os
 
 from codecs import open as open_with_enc
diff --git a/rebench/tests/interop/time_adapter_test.py b/rebench/tests/interop/time_adapter_test.py
index a9b6e0e7..2f1bd9e3 100644
--- a/rebench/tests/interop/time_adapter_test.py
+++ b/rebench/tests/interop/time_adapter_test.py
@@ -33,7 +33,7 @@ class TimeAdapterTest(TestCase):
     def test_acquire_command(self):
         adapter = TimeAdapter(False, None)
         cmd = adapter.acquire_command(_TestRunId())
-        self.assertTrue(cmd.startswith("/usr/bin/time"))
+        self.assertRegex(cmd, r"^/.*/bin/g?time")
 
     def test_parse_data(self):
         data = """real        11.00
diff --git a/rebench/tests/mock_http_server.py b/rebench/tests/mock_http_server.py
index e6b0a0a4..497e31c8 100644
--- a/rebench/tests/mock_http_server.py
+++ b/rebench/tests/mock_http_server.py
@@ -4,24 +4,28 @@
 from threading import Thread
 
 
-_put_requests = 0
-
-
 class _RequestHandler(BaseHTTPRequestHandler):
     def do_GET(self):
         self.send_response(200)
         self.end_headers()
+        self.send_header("Content-Length", 0)
 
     def do_PUT(self):
         self.send_response(200)
+        self.send_header("Content-Length", 0)
         self.end_headers()
-        global _put_requests  # pylint: disable=global-statement
-        _put_requests += 1
+        self.server.put_requests += 1
 
     def log_request(self, code='-', size='-'):
         pass
 
 
+class HTTPServerWithCounter(HTTPServer):
+    def __init__(self, *args, **kwargs):
+        super(HTTPServerWithCounter, self).__init__(*args, **kwargs)
+        self.put_requests = 0
+
+
 class MockHTTPServer(object):
 
     def __init__(self):
@@ -39,10 +43,7 @@ def get_free_port(self):
         return port
 
     def start(self):
-        global _put_requests  # pylint: disable=global-statement
-        _put_requests = 0
-
-        self._server = HTTPServer(('localhost', self._port), _RequestHandler)
+        self._server = HTTPServerWithCounter(('localhost', self._port), _RequestHandler)
 
         self._thread = Thread(target=self._server.serve_forever)
         self._thread.daemon = True
@@ -51,9 +52,7 @@ def start(self):
     def shutdown(self):
         self._server.shutdown()
 
-    @staticmethod
-    def get_number_of_put_requests():
-        global _put_requests  # pylint: disable=global-statement
-        result = _put_requests
-        _put_requests = 0
+    def get_number_of_put_requests(self):
+        result = self._server.put_requests
+        self._server.put_requests = 0
         return result
diff --git a/rebench/tests/subprocess_timeout_test.py b/rebench/tests/subprocess_timeout_test.py
index ddbb5fb2..f0b0bd45 100644
--- a/rebench/tests/subprocess_timeout_test.py
+++ b/rebench/tests/subprocess_timeout_test.py
@@ -53,7 +53,7 @@ def test_exec_with_timeout(self):
         self.assertEqual(None, err)
 
     def test_exec_with_timeout_python_interpreter(self):
-        cmdline = "python -c \"while True: pass\""
+        cmdline = "python3 -c \"while True: pass\""
         (return_code, output, err) = sub.run(cmdline, {}, cwd=self._path,
                                              stdout=subprocess.PIPE,
                                              stderr=subprocess.STDOUT,
diff --git a/rebench/tests/test-vm1.py b/rebench/tests/test-vm1.py
index ad7a6671..f0482e8d 100755
--- a/rebench/tests/test-vm1.py
+++ b/rebench/tests/test-vm1.py
@@ -1,7 +1,5 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # simple script emulating an executor generating benchmark results
-from __future__ import print_function
-
 import sys
 import random
 
diff --git a/rebench/tests/test-vm2.py b/rebench/tests/test-vm2.py
index 1d62a538..d2be03a8 100755
--- a/rebench/tests/test-vm2.py
+++ b/rebench/tests/test-vm2.py
@@ -1,6 +1,5 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # simple script emulating an executor generating benchmark results
-from __future__ import print_function
 import sys
 import random