def METHOD_NAME():
    id = str(uuid4()).split("-")[0]
    class Flow(LightningFlow):
        def __init__(self, db_root=".", restart=False):
            super().__init__()
            self._db_filename = os.path.join(db_root, id)
            self.db = Database(db_filename=self._db_filename, models=[TestConfig])
            self._client = None
            self.restart = restart
        def run(self):
            self.db.run()
            if not self.db.alive():
                return
            if not self._client:
                self._client = DatabaseClient(self.db.db_url, None, model=TestConfig)
            if not self.restart:
                self._client.insert(TestConfig(name="echo", secrets=[Secret(name="example", value="secret")]))
                self.stop()
            else:
                assert os.path.exists(self._db_filename)
                assert len(self._client.select_all()) == 1
                self.stop()
    with tempfile.TemporaryDirectory() as tmpdir:
        app = LightningApp(Flow(db_root=tmpdir))
        MultiProcessRuntime(app).dispatch()
        # Note: Waiting for SIGTERM signal to be handled
        sleep(2)
        app = LightningApp(Flow(db_root=tmpdir, restart=True))
        MultiProcessRuntime(app).dispatch()
        # Note: Waiting for SIGTERM signal to be handled
        sleep(2)