mirror of
https://github.com/progval/irctest.git
synced 2025-04-06 15:29:50 +00:00
speed up oragono tests by reducing the port wait interval
This commit is contained in:
@ -74,6 +74,7 @@ class BaseClientController(_BaseController):
|
|||||||
|
|
||||||
class BaseServerController(_BaseController):
|
class BaseServerController(_BaseController):
|
||||||
"""Base controller for IRC server."""
|
"""Base controller for IRC server."""
|
||||||
|
_port_wait_interval = .1
|
||||||
port_open = False
|
port_open = False
|
||||||
def run(self, hostname, port, password,
|
def run(self, hostname, port, password,
|
||||||
valid_metadata_keys, invalid_metadata_keys):
|
valid_metadata_keys, invalid_metadata_keys):
|
||||||
@ -82,7 +83,7 @@ class BaseServerController(_BaseController):
|
|||||||
raise NotImplementedByController('account registration')
|
raise NotImplementedByController('account registration')
|
||||||
def wait_for_port(self):
|
def wait_for_port(self):
|
||||||
while not self.port_open:
|
while not self.port_open:
|
||||||
time.sleep(0.1)
|
time.sleep(self._port_wait_interval)
|
||||||
try:
|
try:
|
||||||
c = socket.create_connection(('localhost', self.port), timeout=1.0)
|
c = socket.create_connection(('localhost', self.port), timeout=1.0)
|
||||||
c.close()
|
c.close()
|
||||||
|
@ -147,6 +147,7 @@ class OragonoController(BaseServerController, DirectoryBasedController):
|
|||||||
supported_sasl_mechanisms = {
|
supported_sasl_mechanisms = {
|
||||||
'PLAIN',
|
'PLAIN',
|
||||||
}
|
}
|
||||||
|
_port_wait_interval = .01
|
||||||
|
|
||||||
def kill_proc(self):
|
def kill_proc(self):
|
||||||
self.proc.kill()
|
self.proc.kill()
|
||||||
|
Reference in New Issue
Block a user