code: def test_tinydb_observer_failed_event_updates_run(
      tinydb_obs, sample_run
  ):
      tinydb_obs.started_event(**sample_run)
  
      fail_trace = "lots of errors and\nso\non..."
      tinydb_obs.failed_event(fail_time=T2, fail_trace=fail_trace)
  
      assert len(tinydb_obs.runs) == 1
      db_run = tinydb_obs.runs.get(doc_id=1)
      assert db_run["stop_time"] == T2
      assert db_run["status"] == "FAILED"
      assert db_run["fail_trace"] == fail_trace
  
imports: from __future__ import division, print_function, unicode_literals, absolute_import
  import os
  import datetime
  import tempfile
  import io
  import pytest
  from tinydb import TinyDB
  from hashfs import HashFS
  from sacred.dependencies import get_digest
  from sacred.observers.tinydb_hashfs import TinyDbObserver, tiny_db_option
  from sacred.observers.tinydb_hashfs.bases import BufferedReaderWrapper
  from sacred import optional
  from sacred.experiment import Experiment
label_desc: Use image node_id 13 for calling a global function with example usage: test_tinydb_observer_failed_event_updates_run(tinydb_obs, sample_run) without return types