From 9aa468b84e5b5fa43b5bce9ac6c49b0d4dcce2bf Mon Sep 17 00:00:00 2001 From: Georg-Stahn Date: Wed, 10 Jan 2024 15:35:47 +0100 Subject: [PATCH] small emulate changes --- README.md | 2 ++ pkgs/clan-cli/tests/emulate_fastapi.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 5d285c8..89d5105 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,8 @@ sudo echo "experimental-features = nix-command flakes" > '/etc/nix/nix.conf' - The server will automatically restart if any Python files change. - The `--populate` flag will automatically populate the database with dummy data + - To emulate some distributed system behavior run `python3 tests/emulate_fastapi.py` + 8. **Build the Frontend**: - In a different shell, navigate to the `pkgs/ui` directory and execute: diff --git a/pkgs/clan-cli/tests/emulate_fastapi.py b/pkgs/clan-cli/tests/emulate_fastapi.py index 27a492f..1033a81 100644 --- a/pkgs/clan-cli/tests/emulate_fastapi.py +++ b/pkgs/clan-cli/tests/emulate_fastapi.py @@ -1,3 +1,5 @@ +import time + import uvicorn from fastapi import FastAPI from fastapi.responses import HTMLResponse @@ -21,6 +23,7 @@ async def consume_service_from_other_entity() -> HTMLResponse: """ + time.sleep(3) return HTMLResponse(content=html_content, status_code=200)