code: def test_save_now_twice(
      relay_server, user, mock_run, backend_interface
  ):
      run = mock_run(use_magic_mock=True)
      with relay_server() as relay, backend_interface(run) as interface:
          file_path = os.path.join("foo", "test.txt")
          interface.publish_files({"files": [(file_path, "now")]})
          test_file = os.path.join(run.dir, file_path)
          filesystem.mkdir_exists_ok(os.path.dirname(test_file))
          with open(test_file, "w") as f:
              f.write("TEST TEST")
          time.sleep(1.5)
          with open(test_file, "w") as f:
              f.write("TEST TEST TEST TEST")
          interface.publish_files({"files": [(file_path, "now")]})
          time.sleep(1.5)
  
      uploaded_files = relay.context.get_run_uploaded_files(run.id)
      assert uploaded_files.count("foo/test.txt") == 2
  
imports: import json
  import os
  import shutil
  import threading
  import time
  import unittest.mock
  import pytest
  import wandb
  from wandb.errors import CommError
  from wandb.proto import wandb_internal_pb2
  from wandb.sdk.interface.interface import InterfaceBase
  from wandb.sdk.lib import filesystem
label_desc: Use image node_id 15 for calling a global function with example usage: test_save_now_twice(relay_server, user, mock_run, backend_interface) without return types