diff --git a/src/clusterfuzz/_internal/tests/core/metrics/logs_test.py b/src/clusterfuzz/_internal/tests/core/metrics/logs_test.py index a66fd8b6b9..a99a7358a6 100644 --- a/src/clusterfuzz/_internal/tests/core/metrics/logs_test.py +++ b/src/clusterfuzz/_internal/tests/core/metrics/logs_test.py @@ -137,10 +137,12 @@ class FormatRecordTest(unittest.TestCase): def setUp(self): helpers.patch(self, - ['clusterfuzz._internal.metrics.logs.update_entry_with_exc']) + ['clusterfuzz._internal.metrics.logs.update_entry_with_exc', + 'os.getpid']) helpers.patch_environ(self) self.maxDiff = None + self.mock.getpid.return_value = 1337 def get_record(self): """Make a fake record.""" @@ -173,6 +175,7 @@ def test_format_record(self): 'task_payload': 'fuzz fuzzer1 job1', 'fuzz_target': 'fuzz_target1', 'name': 'logger_name', + 'pid': 1337, 'extras': { 'a': 1, }, @@ -197,6 +200,7 @@ def test_no_extras(self): 'bot_name': 'linux-bot', 'task_payload': 'fuzz fuzzer1 job1', 'name': 'logger_name', + 'pid': 1337, 'location': { 'path': 'path', 'line': 123, @@ -220,6 +224,7 @@ def test_worker_bot_name(self): 'worker_bot_name': 'worker', 'task_payload': 'fuzz fuzzer1 job1', 'name': 'logger_name', + 'pid': 1337, 'location': { 'path': 'path', 'line': 123,