Skip to content

Commit

Permalink
Increase some test timeouts to handle when Travis is slow
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 6, 2016
1 parent 63cc762 commit 9ccbe17
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions tests/src/python/test_qgsactionmanager.py
Expand Up @@ -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__':
Expand Down
14 changes: 7 additions & 7 deletions tests/src/python/test_qgsappstartup.py
Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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é€']:
Expand All @@ -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})

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

def testOptionsAsFiles(self):
Expand All @@ -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'])


Expand Down

2 comments on commit 9ccbe17

@m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented on 9ccbe17 Sep 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented on 9ccbe17 Sep 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But thanks a lot!

Please sign in to comment.