code: def test_mark_preempting(mock_run, parse_records, record_q):
      run = mock_run()
      run.log(dict(this=1))
      run.log(dict(that=2))
      run.mark_preempting()
  
      parsed = parse_records(record_q)
  
      assert len(parsed.records) == 3
  
      assert len(parsed.preempting) == 1
      assert parsed.records[-1].HasField("preempting")
  
imports: import copy
  import os
  import platform
  import unittest.mock
  import numpy
  import pytest
  import wandb
  import wandb.errors
  from wandb import wandb_sdk
label_desc: Use image node_id 9 for calling a global function with example usage: test_mark_preempting(mock_run, parse_records, record_q) without return types