docstr: Test that new runs appear after old ones in /data/runs.
docstr_tok: ["Test","that","new","runs","appear","after","old","ones","in","\/data\/runs","."]
code: def testRunsAppendOnly(self):
      """Test that new runs appear after old ones in /data/runs."""
      fake_wall_times = {
          "run1": 1234.0,
          "avocado": 2345.0,
          "zebra": 3456.0,
          "ox": 4567.0,
          "mysterious": None,
          "enigmatic": None,
      }
  
      def FirstEventTimestamp_stub(run_name):
          matches = [
              candidate_name
              for candidate_name in fake_wall_times
              if run_name.endswith(candidate_name)
          ]
          self.assertEqual(
              len(matches), 1, "%s (%s)" % (matches, run_name)
          )
          wall_time = fake_wall_times[matches[0]]
          if wall_time is None:
              raise ValueError("No event timestamp could be found")
          else:
              return wall_time
  
      with mock.patch.object(
          self.multiplexer, "FirstEventTimestamp"
      ) as mock_first_event_timestamp:
          mock_first_event_timestamp.side_effect = (
              FirstEventTimestamp_stub
          )
          # Start with a single run.
          self._add_run("run1")
  
          # Add one run: it should come last.
          self._add_run("avocado")
          self.assertEqual(
              self._get_json(self.server, "/data/runs"),
              ["run1", "avocado"],
          )
  
          # Add another run: it should come last, too.
          self._add_run("zebra")
          self.assertEqual(
              self._get_json(self.server, "/data/runs"),
              ["run1", "avocado", "zebra"],
          )
  
          # And maybe there's a run for which we somehow have no timestamp.
          self._add_run("mysterious")
          self.assertEqual(
              self._get_json(self.server, "/data/runs"),
              ["run1", "avocado", "zebra", "mysterious"],
          )
  
          # Add another timestamped run: it should come before the timestamp-less one.
          self._add_run("ox")
          self.assertEqual(
              self._get_json(self.server, "/data/runs"),
              ["run1", "avocado", "zebra", "ox", "mysterious"],
          )
  
          # Add another timestamp-less run, lexicographically before the other one:
          # it should come after all timestamped runs but first among timestamp-less.
          self._add_run("enigmatic")
          self.assertEqual(
              self._get_json(self.server, "/data/runs"),
              [
                  "run1",
                  "avocado",
                  "zebra",
                  "ox",
                  "enigmatic",
                  "mysterious",
              ],
          )
  
imports: import collections.abc
  import contextlib
  import io
  import json
  import mimetypes
  import os
  from unittest import mock
  import zipfile
  import tensorflow
  from werkzeug import test
  from werkzeug import wrappers
  from tensorboard.backend import application
  from tensorboard.backend.event_processing import data_provider
  from tensorboard.backend.event_processing import plugin_event_multiplexer
  from tensorboard.data import provider
  from tensorboard.plugins import base_plugin
  from tensorboard.plugins.core import core_plugin
  from tensorboard.util import test_util
label_desc: Use image node_id 20 for calling the CorePluginTest obj's underlying member method code with example usage: obj.testRunsAppendOnly() and returns: wall_time