Skip to content

Commit

Permalink
fix: use engine directly in concurrent test instead of trying to conn…
Browse files Browse the repository at this point in the history
…ect to connection

Co-Authored-By: Chris Weaver <chris@onyx.app>
  • Loading branch information
devin-ai-integration[bot] and Chris Weaver committed Jan 30, 2025
1 parent 42460fa commit d143efe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backend/tests/unit/onyx/db/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@


def _call_parallel(engine, email_list: List[str]) -> None:
# Create a new connection and session for each thread to handle SQLite's threading restrictions
connection = engine.connect()
# Create a new session for each thread to handle SQLite's threading restrictions
SessionLocal = sessionmaker(
bind=connection,
bind=engine,
expire_on_commit=False,
autoflush=True,
)
Expand All @@ -28,7 +27,6 @@ def _call_parallel(engine, email_list: List[str]) -> None:
raise
finally:
session.close()
connection.close()


@pytest.mark.parametrize(
Expand Down

0 comments on commit d143efe

Please sign in to comment.