summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-10-19 07:27:46 -0400
committerGitHub <noreply@github.com>2020-10-19 07:27:46 -0400
commit85c56445fb1e708a773c34b8b69a53f8b020bbc2 (patch)
treeae130fe185956554f7e188653f129b9dfb4d1bff
parentStart an opentracing span for background processes. (#8567) (diff)
downloadsynapse-85c56445fb1e708a773c34b8b69a53f8b020bbc2.tar.xz
Support running synmark on macOS. (#8578)
By using the "poll" reactor since macOS doesn't support epoll.
-rw-r--r--changelog.d/8578.misc1
-rw-r--r--synmark/__init__.py7
2 files changed, 6 insertions, 2 deletions
diff --git a/changelog.d/8578.misc b/changelog.d/8578.misc
new file mode 100644
index 0000000000..e93462255b
--- /dev/null
+++ b/changelog.d/8578.misc
@@ -0,0 +1 @@
+Support macOS on the `synmark` benchmark runner.
diff --git a/synmark/__init__.py b/synmark/__init__.py
index 9ec72c1973..09bc7e7927 100644
--- a/synmark/__init__.py
+++ b/synmark/__init__.py
@@ -15,7 +15,10 @@
 
 import sys
 
-from twisted.internet import epollreactor
+try:
+    from twisted.internet.epollreactor import EPollReactor as Reactor
+except ImportError:
+    from twisted.internet.pollreactor import PollReactor as Reactor
 from twisted.internet.main import installReactor
 
 from synapse.config.homeserver import HomeServerConfig
@@ -63,7 +66,7 @@ def make_reactor():
     Instantiate and install a Twisted reactor suitable for testing (i.e. not the
     default global one).
     """
-    reactor = epollreactor.EPollReactor()
+    reactor = Reactor()
 
     if "twisted.internet.reactor" in sys.modules:
         del sys.modules["twisted.internet.reactor"]