Support running synmark on macOS. (#8578)
By using the "poll" reactor since macOS doesn't support epoll.
This commit is contained in:
parent
1fcdbeb3ab
commit
85c56445fb
|
@ -0,0 +1 @@
|
||||||
|
Support macOS on the `synmark` benchmark runner.
|
|
@ -15,7 +15,10 @@
|
||||||
|
|
||||||
import sys
|
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 twisted.internet.main import installReactor
|
||||||
|
|
||||||
from synapse.config.homeserver import HomeServerConfig
|
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
|
Instantiate and install a Twisted reactor suitable for testing (i.e. not the
|
||||||
default global one).
|
default global one).
|
||||||
"""
|
"""
|
||||||
reactor = epollreactor.EPollReactor()
|
reactor = Reactor()
|
||||||
|
|
||||||
if "twisted.internet.reactor" in sys.modules:
|
if "twisted.internet.reactor" in sys.modules:
|
||||||
del sys.modules["twisted.internet.reactor"]
|
del sys.modules["twisted.internet.reactor"]
|
||||||
|
|
Loading…
Reference in New Issue