Skip to content

Commit

Permalink
ci: fix tornado flakyness (#6610)
Browse files Browse the repository at this point in the history
CI: Fix flaky tornado tests, ensure futures is patched before test runs.
This will ensure spans are correlated as expected.

## Checklist
- [x] Change(s) are motivated and described in the PR description.
- [x] Testing strategy is described if automated tests are not included
in the PR.
- [x] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed. If no release note is required, add label
`changelog/no-changelog`.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).
- [x] Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer has explicitly acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment.
- [x] Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

---------

Co-authored-by: Munir Abdinur <munir_abdinur@hotmail.com>
  • Loading branch information
gnufede and mabdinur authored Aug 9, 2023
1 parent 880065f commit bf1b3c2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/contrib/tornado/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from ddtrace.contrib.tornado import patch
from ddtrace.contrib.tornado import unpatch
from ddtrace.contrib.futures import patch as patch_futures
from ddtrace.contrib.futures import unpatch as unpatch_futures
from ddtrace.internal.compat import reload_module
from tests.utils import TracerTestCase

Expand All @@ -19,6 +21,7 @@ class TornadoTestCase(TracerTestCase, AsyncHTTPTestCase):
def get_app(self):
# patch Tornado and reload module app
patch()
patch_futures()
reload_module(compat)
reload_module(app)

Expand All @@ -37,5 +40,6 @@ def tearDown(self):
super(TornadoTestCase, self).tearDown()
# unpatch Tornado
unpatch()
unpatch_futures()
reload_module(compat)
reload_module(app)

0 comments on commit bf1b3c2

Please sign in to comment.