Skip to content

Commit 7ad0b2e

Browse files
committed
Fix UT by clearing env vars at setup
1 parent 9dab364 commit 7ad0b2e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/clusterfuzz/_internal/swarming/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _get_instance_spec(swarming_config: local_config.SwarmingConfig,
6969

7070

7171
def _get_task_name(job_name: str):
72-
return 't-' + str(uuid.uuid4()).lower() + ' ' + job_name
72+
return 't-' + str(uuid.uuid4()).lower() + '-' + job_name
7373

7474

7575
def _get_swarming_config() -> local_config.SwarmingConfig | None:

src/clusterfuzz/_internal/tests/core/swarming/swarming_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414
"""Swarming tests."""
1515
import base64
16+
import os
1617
import unittest
1718
from unittest import mock
1819

@@ -45,6 +46,10 @@ def setUp(self):
4546
self.mock.FeatureFlags.SWARMING_REMOTE_EXECUTION.enabled = True
4647
self.mock.get.return_value = None
4748
self.maxDiff = None
49+
os.environ.pop('DEPLOYMENT_ZIP', None)
50+
os.environ.pop('DEPLOYMENT_BUCKET', None)
51+
os.environ.pop('PROJECT_NAME', None)
52+
os.environ.pop('HOST_JOB_SELECTION', None)
4853

4954
def test_get_spec_from_config_with_docker_image(self):
5055
"""Tests that create_new_task_request works as expected."""

0 commit comments

Comments
 (0)