Skip to content

Commit

Permalink
skip flaky docker tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hallvictoria committed Dec 12, 2024
1 parent 387884b commit 8f54361
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
8 changes: 8 additions & 0 deletions eng/ci/official-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ extends:
dependsOn: Build
jobs:
- template: /eng/templates/jobs/ci-unit-tests.yml@self
- stage: RunDockerConsumptionTests
dependsOn: Build
jobs:
- template: /eng/templates/official/jobs/ci-docker-consumption-tests.yml@self
- stage: RunDockerDedicatedTests
dependsOn: Build
jobs:
- template: /eng/templates/official/jobs/ci-docker-dedicated-tests.yml@self
- stage: RunLinuxConsumptionTests
dependsOn: Build
jobs:
Expand Down
19 changes: 16 additions & 3 deletions tests/endtoend/test_worker_process_count_functions.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
import unittest

from datetime import datetime
from threading import Thread

from tests.utils import testutils
from azure_functions_worker.utils.common import is_envvar_true
from tests.utils.constants import CONSUMPTION_DOCKER_TEST, DEDICATED_DOCKER_TEST


@unittest.skipIf(is_envvar_true(DEDICATED_DOCKER_TEST)
or is_envvar_true(CONSUMPTION_DOCKER_TEST),
"Tests are flaky when running on Docker")
class TestWorkerProcessCount(testutils.WebHostTestCase):
"""Test the Http Trigger with setting up the python worker process count
to 2. this test will check if both requests should be processed at the
Expand Down Expand Up @@ -63,24 +70,30 @@ def http_req(res_num):
self.assertTrue(time_diff_in_seconds < 1)


@unittest.skipIf(is_envvar_true(DEDICATED_DOCKER_TEST)
or is_envvar_true(CONSUMPTION_DOCKER_TEST),
"Tests are flaky when running on Docker")
class TestWorkerProcessCountStein(TestWorkerProcessCount):

@classmethod
def get_script_dir(cls):
return testutils.E2E_TESTS_FOLDER / 'http_functions' /\
'http_functions_stein'


@unittest.skipIf(is_envvar_true(DEDICATED_DOCKER_TEST)
or is_envvar_true(CONSUMPTION_DOCKER_TEST),
"Tests are flaky when running on Docker")
class TestWorkerProcessCountWithBlueprintStein(TestWorkerProcessCount):

@classmethod
def get_script_dir(cls):
return testutils.E2E_TESTS_FOLDER / 'blueprint_functions' /\
'functions_in_blueprint_only'


@unittest.skipIf(is_envvar_true(DEDICATED_DOCKER_TEST)
or is_envvar_true(CONSUMPTION_DOCKER_TEST),
"Tests are flaky when running on Docker")
class TestWorkerProcessCountWithBlueprintDiffDirStein(TestWorkerProcessCount):

@classmethod
def get_script_dir(cls):
return testutils.E2E_TESTS_FOLDER / 'blueprint_functions' /\
Expand Down
6 changes: 5 additions & 1 deletion tests/extension_tests/http_v2_tests/test_http_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@
import requests
from tests.utils import testutils

from azure_functions_worker.utils.common import is_envvar_true
from tests.utils.constants import CONSUMPTION_DOCKER_TEST,DEDICATED_DOCKER_TEST
from azure_functions_worker.constants import PYTHON_ENABLE_INIT_INDEXING

REQUEST_TIMEOUT_SEC = 5


@unittest.skipIf(is_envvar_true(DEDICATED_DOCKER_TEST)
or is_envvar_true(CONSUMPTION_DOCKER_TEST),
"Tests are flaky when running on Docker")
@unittest.skipIf(sys.version_info.minor < 8, "HTTPv2"
"is only supported for 3.8+.")
class TestHttpFunctionsWithInitIndexing(testutils.WebHostTestCase):
Expand Down

0 comments on commit 8f54361

Please sign in to comment.