Skip to content

Conversation

@GunaPalanivel
Copy link
Contributor

Changes

Replaced MagicMock() with Mock() on lines 571 and 589 in test_tracer.py.

Unspecced MagicMock creates infinite child mocks on attribute access, which caused handle() to hang while iterating mock objects. A partial workaround existed (get_data.return_value = {}), but the root mocks were still unspecced.

Testing

  • test_create_new_span passes
  • All other tracer tests pass (32 total)

Note

Two pre-existing failures (test_set_content_tag_updates_input_and_output*) exist on main and are unrelated; should be tracked separately.

@GunaPalanivel GunaPalanivel requested a review from a team as a code owner January 30, 2026 13:19
@GunaPalanivel GunaPalanivel requested review from davidsbatista and removed request for a team January 30, 2026 13:19
@GunaPalanivel
Copy link
Contributor Author

If maintainers prefer a stricter approach, I can switch to:

mock_raw_span = Mock(spec=["operation_name", "metadata", "update", "raw_span"])

The current Mock() change is sufficient for this fix.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(langfuse): test_create_new_span causes excessive RAM usage and hangs due to unspecced MagicMock

1 participant