Skip to content
Permalink
Browse files

Increase some test timeouts to handle when Travis is slow

  • Loading branch information
nyalldawson committed Sep 6, 2016
1 parent 63cc762 commit 9ccbe179a463bff06d3cd645504bffcbf952a041
Showing with 11 additions and 11 deletions.
  1. +4 −4 tests/src/python/test_qgsactionmanager.py
  2. +7 −7 tests/src/python/test_qgsappstartup.py
@@ -203,26 +203,26 @@ def testDoAction(self):

c = QgsExpressionContext()
self.manager.doAction(0, f, c)
time.sleep(0.05)
time.sleep(0.5)

self.assertEqual(self.check_action_result(temp_file), 'test output')

# action with substitutions
temp_file = self.get_temp_filename()
self.manager.addAction(QgsAction.Unix, 'test_action', self.create_action(temp_file, 'test [% $id %] output [% @layer_name %]'))
self.manager.doAction(1, f, c)
time.sleep(0.05)
time.sleep(0.5)

self.assertEqual(self.check_action_result(temp_file), 'test 1 output test_layer')

# test doAction using field variant
temp_file = self.get_temp_filename()
self.manager.addAction(QgsAction.Unix, 'test_action', self.create_action(temp_file, 'test [% @current_field %]'))
self.manager.doActionFeature(2, f, 0)
time.sleep(0.05)
time.sleep(0.5)
self.assertEqual(self.check_action_result(temp_file), 'test 5')
self.manager.doActionFeature(2, f, 1)
time.sleep(0.05)
time.sleep(0.5)
self.assertEqual(self.check_action_result(temp_file), 'test val')

if __name__ == '__main__':
@@ -51,7 +51,7 @@ def tearDownClass(cls):
# TODO: refactor parameters to **kwargs to handle all startup combinations
def doTestStartup(self, option='', testDir='', testFile='',
loadPlugins=False, customization=False,
timeOut=270, env=None, additionalArguments=[]):
timeOut=360, env=None, additionalArguments=[]):
"""Run QGIS with the given option. Wait for testFile to be created.
If time runs out, fail.
"""
@@ -106,14 +106,14 @@ def testOptionsPath(self):
self.doTestStartup(option="--optionspath",
testDir=os.path.join(self.TMP_DIR, p),
testFile=ini,
timeOut=270)
timeOut=360)

def testConfigPath(self):
for p in ['test_config', 'test config', u'test_configé€']:
self.doTestStartup(option="--configpath",
testDir=os.path.join(self.TMP_DIR, p),
testFile="qgis.db",
timeOut=270)
timeOut=360)

def testPluginPath(self):
for t in ['test_plugins', 'test plugins', u'test_pluginsé€']:
@@ -138,7 +138,7 @@ def testPluginPath(self):
option="--optionspath",
testDir=testDir,
testFile="plugin_started.txt",
timeOut=270,
timeOut=360,
loadPlugins=True,
env={'QGIS_PLUGINPATH': testDir})

@@ -158,7 +158,7 @@ def testPyQgisStartupEnvVar(self):
f.close()
self.doTestStartup(
testFile=testfilepath,
timeOut=270,
timeOut=360,
env={'PYQGIS_STARTUP': testmod})

def testOptionsAsFiles(self):
@@ -169,12 +169,12 @@ def testOptionsAsFiles(self):
self.doTestStartup(option="--configpath",
testDir=os.path.join(self.TMP_DIR, 'test_optionsAsFiles'),
testFile="qgis.db",
timeOut=270,
timeOut=360,
additionalArguments=['--help'])
self.doTestStartup(option="--configpath",
testDir=os.path.join(self.TMP_DIR, 'test_optionsAsFiles'),
testFile="qgis.db",
timeOut=270,
timeOut=360,
additionalArguments=['--', '--help'])


2 comments on commit 9ccbe17

@m-kuhn

This comment has been minimized.

Copy link
Member

@m-kuhn m-kuhn replied Sep 7, 2016

Would be nice to let the actions emit a signal when they have finished

@m-kuhn

This comment has been minimized.

Copy link
Member

@m-kuhn m-kuhn replied Sep 7, 2016

But thanks a lot!

Please sign in to comment.
You can’t perform that action at this time.