This repository has been archived by the owner on Feb 15, 2025. It is now read-only.
test: API tests intermittently fail when executing from Apple Silicon #952
Labels
possible-bug 🐛
Something may not be working
Description
There are a few tests that fail on the latest release (
0.11.0
ofleapfrogai_api
) that are in the test_api.py file. These can be broken up into 2 logical groups:Config deletion behaving flakily. This is due to a race condition that spawns from the
Config
class using watchfiles. Watchfiles usesanyio
as the backend for it's async operations, and specifically uses a thread to manage it's "file watch" task. The config deletion step of the test has a sleep present to allow the "update" to be processed by the API. This does not work on a Mac with Apple Silicon, but does appear to work in Linux.Requests with auth not working properly. This is due to a few things. There are 2 problems that are causing this:
app
state is being modified / relied on to execute this test. Because we defineapp
as a global in main.py this means that these modifications could have side effects if other tests / this environment is sustained.localhost
definition in the test config file appears to be causing failures when making GRPC requests. This appears to be solved by switching the host to0.0.0.0
in the config file.Environment
leapfrogai_api
0.11.0
K3D
Steps to reproduce
LFAI_RUN_REPEATER_TESTS=true python3 -m pytest -vv 'tests/pytest'
Expected result
Actual Result
Visual Proof (screenshots, videos, text, etc)
Additional Context
Add any other context or screenshots about the technical debt here.
The text was updated successfully, but these errors were encountered: