Time limit to execute a test
Hi, I have a test taking more than the 10 seconds limit to execute completely. I tried to adjust this limit but failed to get it taken in consideration. I tried from 3 places: - in the test method itself - in TestCase setUp - in a dedicated TestResources The adjustment seems to alway been too late, the limit is still at 10s. To adjust the limit I did as following, for example in a dedicated TestResource: setUp    "Some recursive scripts need more time to execute completely"    defaultTimeLimitBackup := TestCase defaultTimeLimit.    TestCase defaultTimeLimit: 60 seconds. tearDown    TestCase defaultTimeLimit: defaultTimeLimitBackup From the debugger raised at the test fail, I can see the DefaultTimeLimit is correctly set to 60s. If I adjust this time limit before executing test case, for example from the settings browser, it is going fine. But I will prefer adjust it programmatically. Any idea? Thanks Hilaire -- Dr. Geo http://drgeo.eu
On sam. 21 avr. 2018 at 11:55, Hilaire <hilaire@drgeo.eu> wrote:
Hi,
I have a test taking more than the 10 seconds limit to execute completely.
I tried to adjust this limit but failed to get it taken in consideration. I tried from 3 places:
- in the test method itself
- in TestCase setUp
- in a dedicated TestResources
The adjustment seems to alway been too late, the limit is still at 10s.
To adjust the limit I did as following, for example in a dedicated TestResource:
setUp "Some recursive scripts need more time to execute completely" defaultTimeLimitBackup := TestCase defaultTimeLimit. TestCase defaultTimeLimit: 60 seconds.
tearDown TestCase defaultTimeLimit: defaultTimeLimitBackup
From the debugger raised at the test fail, I can see the DefaultTimeLimit is correctly set to 60s.
If I adjust this time limit before executing test case, for example from the settings browser, it is going fine. But I will prefer adjust it programmatically.
Any idea?
Hi, I don't have a computer to check but inside the test you should be able to call a method as #timeLimit:. I'm not sure of the name. Also, if you want to raise the time limit of all the tests of the class, you don't need to call #defaultTimeLimit: but you need to override #defaultTimeLimit.
Thanks
Hilaire
-- Dr. Geo http://drgeo.eu
-- Cyril Ferlicot https://ferlicot.fr
Ah yes, it does it. Thanks Le 21/04/2018 à 11:58, Cyril Ferlicot a écrit :
I don't have a computer to check but inside the test you should be able to call a method as #timeLimit:. I'm not sure of the name.
-- Dr. Geo http://drgeo.eu
participants (2)
-
Cyril Ferlicot -
Hilaire