Skip to content

intentservice global state (is_loaded/intents_active) not reset between tests #2124

Description

@patriciapampanelli

intentservice.is_loaded/intents_active are module globals and no fixture resets them. Suite runs single-process, so whichever test last called load() decides the next test's state.

Observed while reviewing #1775: test_probe_prompt_translation[probes.tap.TAPIntent] flips result by run order alone:

python -m pytest -p no:cacheprovider   "tests/langservice/probes/test_probes_base.py::test_probe_prompt_translation[probes.tap.TAPIntent]" "tests/probes/test_probes.py::test_probe_metadata[probes.audio.AudioAchillesHeel]"  -v
# SKIPPED

python -m pytest -p no:cacheprovider    "tests/probes/test_probes.py::test_probe_metadata[probes.audio.AudioAchillesHeel]" "tests/langservice/probes/test_probes_base.py::test_probe_prompt_translation[probes.tap.TAPIntent]"  -v
# FAILED: assert 0 == 93 (real bug: TAPIntent.probe() never calls get_text)

Pre-existing, outside #1775's diff

Precedent: langservice has the same issue, already fixed via tests/langservice/conftest.py::clear_langprovider_state. Needs the equivalent for intentservice.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageFor issues that have not been assessed by project maintainers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions