Skip to content

Commit eef7628

Browse files
Flaky durable tests (#1385)
* timeout in durable tests * lint * close request object * increased timeout, retries * removed setup for durable, no constant for debug * global var * added method to testutils * refactoring * fixes for durable only * flake issues * http setting issue * formatting * reformatting * merge miss * removed patch env, removing env var after test * only remove from cls dict * super setupclass * actually setting env var --------- Co-authored-by: gavin-aguiar <80794152+gavin-aguiar@users.noreply.github.com>
1 parent 6ee4a77 commit eef7628

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

tests/endtoend/test_durable_functions.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import os
55
import time
66
from unittest import skipIf
7-
from unittest.mock import patch
87

98
import requests
109

@@ -20,31 +19,28 @@ class TestDurableFunctions(testutils.WebHostTestCase):
2019

2120
@classmethod
2221
def setUpClass(cls):
23-
cls.env_variables['WEBSITE_HOSTNAME'] = "http:"
24-
os_environ = os.environ.copy()
25-
os_environ.update(cls.env_variables)
26-
27-
cls._patch_environ = patch.dict('os.environ', os_environ)
28-
cls._patch_environ.start()
22+
os.environ["WEBSITE_HOSTNAME"] = "http:"
2923
super().setUpClass()
3024

3125
@classmethod
3226
def tearDownClass(cls):
27+
# Remove the WEBSITE_HOSTNAME environment variable
28+
os.environ.pop('WEBSITE_HOSTNAME')
3329
super().tearDownClass()
34-
cls._patch_environ.stop()
35-
36-
@classmethod
37-
def get_libraries_to_install(cls):
38-
return ['azure-functions-durable']
3930

4031
@classmethod
4132
def get_environment_variables(cls):
4233
return cls.env_variables
4334

35+
@classmethod
36+
def get_libraries_to_install(cls):
37+
return ['azure-functions-durable']
38+
4439
@classmethod
4540
def get_script_dir(cls):
4641
return testutils.E2E_TESTS_FOLDER / 'durable_functions'
4742

43+
@testutils.retryable_test(3, 5)
4844
def test_durable(self):
4945
r = self.webhost.request('GET',
5046
'orchestrators/DurableFunctionsOrchestrator')

0 commit comments

Comments
 (0)