message: Supplement multi_worker_callback_tf2_test.py with tests that have the same file path for ModelCheckpoint and TensorBoard callbacks.
diff: @@ -109,6 +109,32 @@ class KerasCallbackMultiProcessTest(parameterized.TestCase, test.TestCase):
  cluster_spec=test_base.create_cluster_spec(num_workers=2),
  args=(self, file_format))
  + @combinations.generate(combinations.combine(mode=['eager']))
  + def test_model_checkpoint_works_with_same_file_path(self, mode):
  +
  + def proc_model_checkpoint_works_with_same_file_path(
  + test_obj, saving_filepath):
  + model, _, train_ds, steps = _model_setup(test_obj, file_format='')
  + num_epoch = 10
  +
  + # The saving_filepath shouldn't exist at the beginning (as it's unique).
  + test_obj.assertFalse(file_io.file_exists(saving_filepath))
  +
  + model.fit(
  + x=train_ds,
  + epochs=num_epoch,
  + steps_per_epoch=steps,
  + callbacks=[callbacks.ModelCheckpoint(filepath=saving_filepath)])
  +
  + test_obj.assertTrue(file_io.file_exists(saving_filepath))
  +
  + saving_filepath = os.path.join(self.get_temp_dir(), 'checkpoint')
  +
  + multi_process_runner.run(
  + proc_model_checkpoint_works_with_same_file_path,
  + cluster_spec=test_base.create_cluster_spec(num_workers=20),
  + args=(self, saving_filepath))
  +
  @combinations.generate(combinations.combine(mode=['eager']))
  def test_tensorboard_saves_on_chief_but_not_otherwise(self, mode):
  @@ -174,6 +200,31 @@ class KerasCallbackMultiProcessTest(parameterized.TestCase, test.TestCase):
  cluster_spec=test_base.create_cluster_spec(num_workers=2),
  args=(self,))
  + @combinations.generate(combinations.combine(mode=['eager']))
  + def test_tensorboard_works_with_same_file_path(self, mode):
  +
  + def proc_tensorboard_works_with_same_file_path(test_obj, saving_filepath):
  + model, _, train_ds, steps = _model_setup(test_obj, file_format='')
  + num_epoch = 2
  +
  + # The saving_filepath shouldn't exist at the beginning (as it's unique).
  + test_obj.assertFalse(file_io.file_exists(saving_filepath))
  +
  + model.fit(
  + x=train_ds,
  + epochs=num_epoch,
  + steps_per_epoch=steps,
  + callbacks=[callbacks.TensorBoard(log_dir=saving_filepath)])
  +
  + test_obj.assertTrue(file_io.list_directory(saving_filepath))
  +
  + saving_filepath = os.path.join(self.get_temp_dir(), 'logfile')
  +
  + multi_process_runner.run(
  + proc_tensorboard_works_with_same_file_path,
  + cluster_spec=test_base.create_cluster_spec(num_workers=2),
  + args=(self, saving_filepath))
  +
  @combinations.generate(combinations.combine(mode=['eager']))
  def test_early_stopping(self, mode):
  