File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/clusterfuzz/_internal/tests/core/metrics Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -137,10 +137,12 @@ class FormatRecordTest(unittest.TestCase):
137137
138138 def setUp (self ):
139139 helpers .patch (self ,
140- ['clusterfuzz._internal.metrics.logs.update_entry_with_exc' ])
140+ ['clusterfuzz._internal.metrics.logs.update_entry_with_exc' ,
141+ 'os.getpid' ])
141142 helpers .patch_environ (self )
142143
143144 self .maxDiff = None
145+ self .mock .getpid .return_value = 1337
144146
145147 def get_record (self ):
146148 """Make a fake record."""
@@ -173,6 +175,7 @@ def test_format_record(self):
173175 'task_payload' : 'fuzz fuzzer1 job1' ,
174176 'fuzz_target' : 'fuzz_target1' ,
175177 'name' : 'logger_name' ,
178+ 'pid' : 1337 ,
176179 'extras' : {
177180 'a' : 1 ,
178181 },
@@ -197,6 +200,7 @@ def test_no_extras(self):
197200 'bot_name' : 'linux-bot' ,
198201 'task_payload' : 'fuzz fuzzer1 job1' ,
199202 'name' : 'logger_name' ,
203+ 'pid' : 1337 ,
200204 'location' : {
201205 'path' : 'path' ,
202206 'line' : 123 ,
@@ -220,6 +224,7 @@ def test_worker_bot_name(self):
220224 'worker_bot_name' : 'worker' ,
221225 'task_payload' : 'fuzz fuzzer1 job1' ,
222226 'name' : 'logger_name' ,
227+ 'pid' : 1337 ,
223228 'location' : {
224229 'path' : 'path' ,
225230 'line' : 123 ,
You can’t perform that action at this time.
0 commit comments