Janet Carson
10/31/2024, 12:01 AMtests/test_prefect.py F
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> captured stderr >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
16:53:38.572 | INFO | prefect - Starting temporary server on <http://127.0.0.1:8211>
See <https://docs.prefect.io/3.0/manage/self-host#self-host-a-prefect-server> for more information on running a dedicated Prefect server.
snip
File "/<snip>pipeline/.nox/test/lib/python3.10/site-packages/alembic/runtime/migration.py", line 628, in run_migrations
step.migration_fn(**kw)
File "/<snip>pipeline/.nox/test/lib/python3.10/site-packages/prefect/server/database/migrations/versions/sqlite/2024_09_16_162719_4ad4658cbefe_add_deployment_to_global_concurrency_.py", line 51, in upgrade
op.execute(sql)
snip
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near "FROM": syntax error
[SQL:
WITH deployment_limit_mapping AS (
SELECT d.id AS deployment_id, l.id AS limit_id
FROM deployment d
JOIN concurrency_limit_v2 l ON l.name = 'deployment:' || d.id
)
UPDATE deployment
SET concurrency_limit_id = dlm.limit_id
FROM deployment_limit_mapping dlm
WHERE deployment.id = dlm.deployment_id;
Test fails at call to with_prefect_test_harness() as follows:
.nox/test/lib/python3.10/site-packages/prefect/testing/utilities.py:157: in prefect_test_harness
test_server.start(
snip
> raise RuntimeError(error_message)
E RuntimeError: Timed out while attempting to connect to ephemeral Prefect API server.
.nox/test/lib/python3.10/site-packages/prefect/server/api/server.py:822: RuntimeError
Jeff Hale
10/31/2024, 1:22 PMtest
profile with this as output from `prefect version`:
Version: 3.0.10
API version: 0.8.4
Python version: 3.12.2
Git commit: 3aa2d893
Built: Tue, Oct 15, 2024 1:31 PM
OS/Arch: darwin/arm64
Profile: test
Server type: ephemeral
Pydantic version: 2.8.2
Server:
Database: sqlite
SQLite version: 3.45.2
prefect profile inspect
output:
PREFECT_SERVER_ALLOW_EPHEMERAL_MODE='true'
PREFECT_API_DATABASE_CONNECTION_URL='sqlite+aiosqlite:///:
memory:'
Janet Carson
10/31/2024, 4:30 PMVersion: 3.0.10
API version: 0.8.4
Python version: 3.10.15
Git commit: 3aa2d893
Built: Tue, Oct 15, 2024 1:31 PM
OS/Arch: linux/x86_64
Profile: test
Server type: ephemeral
Pydantic version: 2.8.2
Server:
Database: sqlite
SQLite version: 3.31.1
Janet Carson
10/31/2024, 5:26 PMJeff Hale
10/31/2024, 6:11 PMtest_harness
runs against a sqlite db only. Code.
DB_PATH = "sqlite+aiosqlite:///" + str(Path(temp_dir) / "prefect-test.db")
This Prefect Docker Compose example repo from @Emil Rex Christensen uses PostgreSQL, but could be modified to use sqlite if you wanted to test there.Janet Carson
10/31/2024, 7:25 PMJanet Carson
10/31/2024, 11:17 PMprefect_test_harness
?Janet Carson
10/31/2024, 11:19 PMJeff Hale
11/01/2024, 1:33 PMJanet Carson
11/01/2024, 3:49 PMJanet Carson
11/01/2024, 3:50 PMJeff Hale
11/01/2024, 4:41 PMJanet Carson
11/01/2024, 4:59 PMJanet Carson
11/01/2024, 5:03 PMJeff Hale
11/01/2024, 5:37 PMJanet Carson
11/01/2024, 6:16 PMJanet Carson
11/01/2024, 10:37 PM