Skip to content

Commit

Permalink
Fix tests broken by pid logging (#4384)
Browse files Browse the repository at this point in the history
This was added in #4383
  • Loading branch information
jonathanmetzman authored Nov 7, 2024
1 parent c26e353 commit de8fbac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/clusterfuzz/_internal/tests/core/metrics/logs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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,
},
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit de8fbac

Please sign in to comment.