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

chore(langchain): disable flaky tests #11511

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Kyle-Verhoog
Copy link
Member

@Kyle-Verhoog Kyle-Verhoog commented Nov 22, 2024

There appear to be stability issues with using snapshots and/or LangChain in general.

There are failures in the mocked tests that look like:

builtins.AssertionError: assert 0 == 1
 +  where 0 = <MagicMock name='LLMObsSpanWriter().enqueue' id='127482146130048'>.call_count
 +    where <MagicMock name='LLMObsSpanWriter().enqueue' id='127482146130048'> = <MagicMock name='LLMObsSpanWriter()' id='127482147073440'>.enqueue

as well as failures with snapshot based tests:

builtins.Failed: At request <Request GET /test/session/snapshot >:
   At snapshot (token='tests.contrib.langchain.test_langchain_community.test_lcel_chain_simple'):
    - Directory: /go/src/github.com/DataDog/apm-reliability/dd-trace-py/tests/snapshots
    - CI mode: 1
    - Trace File: /go/src/github.com/DataDog/apm-reliability/dd-trace-py/tests/snapshots/tests.contrib.langchain.test_langchain_community.test_lcel_chain_simple.json
    - Stats File: /go/src/github.com/DataDog/apm-reliability/dd-trace-py/tests/snapshots/tests.contrib.langchain.test_langchain_community.test_lcel_chain_simple_tracestats.json
    At compare of 1 expected trace(s) to 0 received trace(s):
Did not receive expected traces: 'langchain.request'

While we investigate a more stable method of testing it makes sense to disable the tests to avoid noise to our neighbours in the library :).

DOWN WITH FLAKY TESTS

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

@Kyle-Verhoog Kyle-Verhoog requested a review from a team as a code owner November 22, 2024 19:02
@Kyle-Verhoog Kyle-Verhoog added the changelog/no-changelog A changelog entry is not required for this PR. label Nov 22, 2024
Copy link
Contributor

github-actions bot commented Nov 22, 2024

CODEOWNERS have been resolved as:

tests/contrib/langchain/test_langchain_llmobs.py                        @DataDog/ml-observability

@pr-commenter
Copy link

pr-commenter bot commented Nov 22, 2024

Benchmarks

Benchmark execution time: 2024-11-27 22:08:43

Comparing candidate commit 9e13565 in PR branch kylev/flaky-tests-should-be-shot-into-the-sun with baseline commit 21f43e5 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 388 metrics, 2 unstable metrics.

@Yun-Kim Yun-Kim enabled auto-merge (squash) November 25, 2024 21:47
There appear to be stability issues with using snapshots and/or
LangChain in general.

There are failures in the mocked tests that look like:

```
builtins.AssertionError: assert 0 == 1
 +  where 0 = <MagicMock name='LLMObsSpanWriter().enqueue' id='127482146130048'>.call_count
 +    where <MagicMock name='LLMObsSpanWriter().enqueue' id='127482146130048'> = <MagicMock name='LLMObsSpanWriter()' id='127482147073440'>.enqueue
```

as well as failures with snapshot based tests:

```
builtins.Failed: At request <Request GET /test/session/snapshot >:
   At snapshot (token='tests.contrib.langchain.test_langchain_community.test_lcel_chain_simple'):
    - Directory: /go/src/github.com/DataDog/apm-reliability/dd-trace-py/tests/snapshots
    - CI mode: 1
    - Trace File: /go/src/github.com/DataDog/apm-reliability/dd-trace-py/tests/snapshots/tests.contrib.langchain.test_langchain_community.test_lcel_chain_simple.json
    - Stats File: /go/src/github.com/DataDog/apm-reliability/dd-trace-py/tests/snapshots/tests.contrib.langchain.test_langchain_community.test_lcel_chain_simple_tracestats.json
    At compare of 1 expected trace(s) to 0 received trace(s):
Did not receive expected traces: 'langchain.request'
```

While we investigate a more stable method of testing it makes sense to
disable the tests to avoid noise to our neighbours in the library :).

DOWN WITH FLAKY TESTS
@Kyle-Verhoog Kyle-Verhoog force-pushed the kylev/flaky-tests-should-be-shot-into-the-sun branch from fbee49d to c07e703 Compare November 27, 2024 20:22
we can always reintroduce, commenting out is just messy with imports and
such
@Kyle-Verhoog Kyle-Verhoog force-pushed the kylev/flaky-tests-should-be-shot-into-the-sun branch from c07e703 to 92ee3b7 Compare November 27, 2024 20:29
@datadog-dd-trace-py-rkomorn
Copy link

Datadog Report

Branch report: kylev/flaky-tests-should-be-shot-into-the-sun
Commit report: 92ee3b7
Test service: dd-trace-py

✅ 0 Failed, 55 Passed, 1413 Skipped, 1m 18.71s Total duration (34m 44.55s time saved)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants