code: def test_metric_nan_max(relay_server, user, publish_util, mock_run):
      history = []
      history.append(dict(step=0, data=dict(v2=2)))
      history.append(dict(step=1, data=dict(v2=8)))
      history.append(dict(step=2, data=dict(v2=float("nan"))))
  
      m1 = pb.MetricRecord(name="v2")
      m1.summary.max = True
      metrics = _make_metrics([m1])
  
      run = mock_run(use_magic_mock=True)
      with relay_server() as relay:
          publish_util(run=run, metrics=metrics, history=history)
  
      summary = relay.context.get_run_summary(run.id)
      assert summary["v2"] == {"max": 8}
  
imports: from wandb.proto import wandb_internal_pb2
label_desc: Use image node_id 16 for calling a global function with example usage: test_metric_nan_max(relay_server, user, publish_util, mock_run) without return types