Skip to content

Commit c70c381

Browse files
YunchuWangpeterstone2017
andauthored
label flaky httpfunction tests in thirdparty pystein http tests (#1060)
* lable flaky httpfunction tests in thirdparty pystein http tests * fix pytest import Co-authored-by: peterstone2017 <[email protected]>
1 parent 98053f1 commit c70c381

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/unittests/test_third_party_http_functions.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pathlib
66
import re
77
import typing
8+
import pytest
89
from unittest.mock import patch
910

1011
from azure_functions_worker import testutils
@@ -76,6 +77,7 @@ def check_log_debug_with_user_logging(self,
7677
self.assertIn('logging debug', host_out)
7778
self.assertIn('logging error', host_out)
7879

80+
@pytest.mark.flaky(reruns=3)
7981
def test_print_logging_no_flush(self):
8082
r = self.webhost.request('GET', 'print_logging?message=Secret42',
8183
no_prefix=True)
@@ -85,6 +87,7 @@ def test_print_logging_no_flush(self):
8587
def check_log_print_logging_no_flush(self, host_out: typing.List[str]):
8688
self.assertIn('Secret42', host_out)
8789

90+
@pytest.mark.flaky(reruns=3)
8891
def test_print_logging_with_flush(self):
8992
r = self.webhost.request('GET',
9093
'print_logging?flush=true&message'
@@ -97,6 +100,7 @@ def check_log_print_logging_with_flush(self,
97100
host_out: typing.List[str]):
98101
self.assertIn('Secret42', host_out)
99102

103+
@pytest.mark.flaky(reruns=3)
100104
def test_print_to_console_stdout(self):
101105
r = self.webhost.request('GET',
102106
'print_logging?console=true&message'
@@ -105,6 +109,7 @@ def test_print_to_console_stdout(self):
105109
self.assertEqual(r.status_code, 200)
106110
self.assertEqual(r.text, 'OK-print-logging')
107111

112+
@pytest.mark.flaky(reruns=3)
108113
def check_log_print_to_console_stdout(self,
109114
host_out: typing.List[str]):
110115
# System logs stdout should not exist in host_out
@@ -192,6 +197,7 @@ def get_script_dir(cls):
192197
return UNIT_TESTS_ROOT / 'third_party_http_functions' / 'stein' / \
193198
'asgi_function'
194199

200+
@pytest.mark.flaky(reruns=3)
195201
def test_hijack_current_event_loop(self):
196202
r = self.webhost.request('GET', 'hijack_current_event_loop',
197203
no_prefix=True)

0 commit comments

Comments
 (0)