async def METHOD_NAME() -> None:
    """Test resetting runs history when the persistence directory is corrupted."""
    port = "15555"
    persistence_dir = _get_corrupt_persistence_dir()
    async with RobotClient.make(
        base_url=f"http://localhost:{port}", version="*"
    ) as robot_client:
        assert (
            await robot_client.wait_until_dead()
        ), "Dev Robot is running and must not be."
        with DevServer(port=port, persistence_directory=persistence_dir) as server:
            server.start()
            await _wait_until_initialization_failed(robot_client)
            await robot_client.post_setting_reset_options({"runsHistory": True})
            # Restart to enact the reset.
            server.stop()
            assert await robot_client.wait_until_dead(), "Dev Robot did not stop."
            server.start()
            assert (
                await robot_client.wait_until_alive()
            ), "Dev Robot never became available."
            await _assert_reset_was_successful(
                robot_client=robot_client,
                persistence_directory=server.persistence_directory,
            )
            server.stop()