Skip to content

Commit bf1b3c2

Browse files
gnufedemabdinur
andauthored
ci: fix tornado flakyness (#6610)
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 <[email protected]>
1 parent 880065f commit bf1b3c2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/contrib/tornado/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from ddtrace.contrib.tornado import patch
44
from ddtrace.contrib.tornado import unpatch
5+
from ddtrace.contrib.futures import patch as patch_futures
6+
from ddtrace.contrib.futures import unpatch as unpatch_futures
57
from ddtrace.internal.compat import reload_module
68
from tests.utils import TracerTestCase
79

@@ -19,6 +21,7 @@ class TornadoTestCase(TracerTestCase, AsyncHTTPTestCase):
1921
def get_app(self):
2022
# patch Tornado and reload module app
2123
patch()
24+
patch_futures()
2225
reload_module(compat)
2326
reload_module(app)
2427

@@ -37,5 +40,6 @@ def tearDown(self):
3740
super(TornadoTestCase, self).tearDown()
3841
# unpatch Tornado
3942
unpatch()
43+
unpatch_futures()
4044
reload_module(compat)
4145
reload_module(app)

0 commit comments

Comments
 (0)