Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions libs/opsqueue_python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from typing import Generator, Callable, Any, Iterable
import multiprocessing
import subprocess
import uuid
import os
import pytest
from dataclasses import dataclass
Expand Down Expand Up @@ -59,7 +58,14 @@ def opsqueue_service(
if port is None:
port = random_free_port()

temp_dbname = f"/tmp/opsqueue_tests-{uuid.uuid4()}.db"
# This will create a SQLite database in memory.
# We need the `cache=shared` to allow sharing this DB between all threads within the same OS process.
temp_dbname = "file::memory:?cache=shared"

# Switch this for the following if debugging a particular test locally.
# This is not the default because specifically Semaphore backed with Butterfs
# will from time to time hang for **many minutes** on initializing SQLite for some reason.
# temp_dbname = f"/tmp/opsqueue_tests-{uuid.uuid4()}.db"

command = [
str(opsqueue_bin_location()),
Expand Down