code: def test_metric_step_sync(mock_run, parse_records, record_q):
      run = mock_run()
      metric_1 = run.define_metric(
          "metric",
          step_metric="globalstep",
          step_sync=True,
      )
      assert metric_1.step_sync is True
  
      metric_2 = run.define_metric(
          "metric2",
          step_metric="globalstep",
      )
      # default is true when step_metric is set
      assert metric_2.step_sync
  
      metric_3 = run.define_metric(
          "metric3",
          step_metric="globalstep",
          step_sync=False,
      )
      assert not metric_3.step_sync
  
      parsed = parse_records(record_q)
      assert len(parsed.records) == 3
      assert len(parsed.metric) == 3
  
file_path: wandb/tests/pytest_tests/unit_tests/test_wandb_define_metric.py
imports: import pytest
  import wandb
  from wandb.proto import wandb_internal_pb2
label_desc: Use image node_id 7 for calling a global function with example usage: test_metric_step_sync(mock_run, parse_records, record_q) without return types