ci(integrations): makes test_single_trace_too_large less flaky#6119
Merged
mabdinur merged 4 commits intoJun 14, 2023
Conversation
0aa4cd8 to
2ba1036
Compare
mabdinur
commented
Jun 14, 2023
89344a7 to
3b8b6a1
Compare
emmettbutler
left a comment
Collaborator
There was a problem hiding this comment.
I'm not sure I understand why the test failing on this pull request's CI runs is a useful signal. Shouldn't we make sure it passes before merge?
de32d5f to
0ca0c61
Compare
Contributor
Author
Sorry, I opened this PR too early. My first implementation was incorrect. I am currently working on a better solution. This ci fix is hard to test because its timing based (I think a slower machine or slower connection to the agent causes this test to fail in ci). The best we can do is rerun ci multiple times and hope this test no longer flaky. |
mabdinur
commented
Jun 14, 2023
mabdinur
commented
Jun 14, 2023
c85f956 to
1281c2f
Compare
Yun-Kim
approved these changes
Jun 14, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Looking at the failing test below we can see
test_single_trace_too_largegenerates over 20MB of trace data but these traces can be sent in separate payloads (yay partial flushing). This PR mocksAgentWriter.flush_queue()to ensure traces are not submitted. With this change theBufferFullexception will be consistently raised and"trace buffer (%s traces %db/%db) cannot fit trace of size %db, dropping (writer status: %s)"will always be logged.This PR:
tracer.shutdown()this test should not submit traces to the agent.Background
This test consistently passes locally but often fails in ci (and mainly on older versions of python). My hypothesis is that the time interval to submit traces to the agent is too short. The test does not have enough time to add the trace chunks to overflow the trace encoder's buffer.
Sample failure: https://app.circleci.com/pipelines/github/DataDog/dd-trace-py/37860/workflows/4da477db-5289-40b1-8375-5d6152f14b8f/jobs/2546383
Testing Strategy
YOLO. If
test_single_trace_too_largeis still flaky after this PR is merged then I have failed my reviewers and myself.Checklist
Reviewer Checklist