Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agent's tests are failing with ScopeMismatch #648

Open
2 tasks
apryiomka opened this issue Dec 17, 2024 · 3 comments
Open
2 tasks

Agent's tests are failing with ScopeMismatch #648

apryiomka opened this issue Dec 17, 2024 · 3 comments
Assignees
Milestone

Comments

@apryiomka
Copy link

System Info

WIndows/WSL Ubuntu 22.xx

Information

  • The official example scripts
  • My own modified scripts

🐛 Describe the bug

Trying to run tests in v0.0.61:

pytest -s -m remote llama_stack/providers/tests/agents/test_agents.py --env REMOTE_ STACK_URL=$REMOTE_STACK_URL --env INFERENCE_MODEL=$INFERENCE_MODEL

Getting the error:

Error logs

================================================= test session starts ==================================================
platform linux -- Python 3.12.8, pytest-7.4.0, pluggy-1.5.0
rootdir: /meta/llama-stack
plugins: asyncio-0.21.0, anyio-4.7.0
asyncio: mode=Mode.STRICT
collected 25 items / 20 deselected / 5 selected

llama_stack/providers/tests/agents/test_agents.py EEEEE

======================================================== ERRORS ========================================================
_________________ ERROR at setup of TestAgents.test_agent_turns_with_safety[--remote][remote] _________________
ScopeMismatch: You tried to access the function scoped fixture event_loop with a session scoped request object, involved factories:
llama_stack/providers/tests/agents/fixtures.py:61: def agents_stack(request, inference_model, safety_shield)
____________________ ERROR at setup of TestAgents.test_create_agent_turn[--remote][remote] ____________________
ScopeMismatch: You tried to access the function scoped fixture event_loop with a session scoped request object, involved factories:
llama_stack/providers/tests/agents/fixtures.py:61: def agents_stack(request, inference_model, safety_shield)
________________ ERROR at setup of TestAgents.test_rag_agent_as_attachments[--remote][remote] _________________
ScopeMismatch: You tried to access the function scoped fixture event_loop with a session scoped request object, involved factories:
llama_stack/providers/tests/agents/fixtures.py:61: def agents_stack(request, inference_model, safety_shield)
___________ ERROR at setup of TestAgents.test_create_agent_turn_with_brave_search[--remote][remote] ___________
ScopeMismatch: You tried to access the function scoped fixture event_loop with a session scoped request object, involved factories:
llama_stack/providers/tests/agents/fixtures.py:61: def agents_stack(request, inference_model, safety_shield)
__________ ERROR at setup of TestAgents.test_create_agent_turn_with_tavily_search[--remote][remote] ___________
ScopeMismatch: You tried to access the function scoped fixture event_loop with a session scoped request object, involved factories:
llama_stack/providers/tests/agents/fixtures.py:61: def agents_stack(request, inference_model, safety_shield)
=============================================== short test summary info ================================================
ERROR llama_stack/providers/tests/agents/test_agents.py::TestAgents::test_agent_turns_with_safety[--remote] - Failed: ScopeMismatch: You tried to access the function scoped fixture event_loop with a session scoped request obj...
ERROR llama_stack/providers/tests/agents/test_agents.py::TestAgents::test_create_agent_turn[--remote] - Failed: ScopeMismatch: You tried to access the function scoped fixture event_loop with a session scoped request obj...
ERROR llama_stack/providers/tests/agents/test_agents.py::TestAgents::test_rag_agent_as_attachments[--remote] - Failed: ScopeMismatch: You tried to access the function scoped fixture event_loop with a session scoped request obj...
ERROR llama_stack/providers/tests/agents/test_agents.py::TestAgents::test_create_agent_turn_with_brave_search[--remote] - Failed: ScopeMismatch: You tried to access the function scoped fixture event_loop with a session scoped request obj...
ERROR llama_stack/providers/tests/agents/test_agents.py::TestAgents::test_create_agent_turn_with_tavily_search[--remote] - Failed: ScopeMismatch: You tried to access the function scoped fixture event_loop with a session scoped request obj

Expected behavior

The tests run

@apryiomka apryiomka changed the title Agent's tests are failing with "wrong" scope Agent's tests are failing with ScopeMismatch Dec 17, 2024
@ashwinb
Copy link
Contributor

ashwinb commented Dec 18, 2024

I am somehow not able to reproduce this and might be a Windows issue. Llama stack's Windows support is quite sad right now.

@apryiomka
Copy link
Author

apryiomka commented Dec 19, 2024

this is not windows, this is linux/WSL. BTW, do you have a docker image just for the tests?

@apryiomka
Copy link
Author

apryiomka commented Dec 19, 2024

This is the Dockerfile, reproducible 100%:

FROM python:3.12

RUN apt update

WORKDIR /meta

RUN git clone https://github.com/meta-llama/llama-stack.git && cd llama-stack && git checkout tags/v0.0.61

WORKDIR /meta/llama-stack

RUN pip install -r requirements.txt

COPY test-requirements.txt .

RUN pip install -r test-requirements.txt

ENTRYPOINT ["pytest", "-s", "-m", "remote", "llama_stack/providers/tests/agents/test_agents.py"]

This is the test-requirements.txt

pytest==7.4.0
pytest-asyncio==0.21.0
llama-models==0.0.61

@hardikjshah hardikjshah added this to the v0.1 milestone Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants