@@ -1140,26 +1140,13 @@ def test_early_exit(tracer, test_spans):
11401140
11411141class TestPartialFlush (TracerTestCase ):
11421142 @TracerTestCase .run_in_subprocess (
1143- env_overrides = dict (DD_TRACER_PARTIAL_FLUSH_ENABLED = "true" , DD_TRACER_PARTIAL_FLUSH_MIN_SPANS = "5" )
1143+ env_overrides = dict (DD_TRACE_PARTIAL_FLUSH_ENABLED = "true" , DD_TRACE_PARTIAL_FLUSH_MIN_SPANS = "5" )
11441144 )
11451145 def test_partial_flush (self ):
1146- root = self .tracer .trace ("root" )
1147- for i in range (5 ):
1148- self .tracer .trace ("child%s" % i ).finish ()
1149-
1150- traces = self .pop_traces ()
1151- assert len (traces ) == 1
1152- assert len (traces [0 ]) == 5
1153- assert [s .name for s in traces [0 ]] == ["child0" , "child1" , "child2" , "child3" , "child4" ]
1154-
1155- root .finish ()
1156- traces = self .pop_traces ()
1157- assert len (traces ) == 1
1158- assert len (traces [0 ]) == 1
1159- assert traces [0 ][0 ].name == "root"
1146+ self ._test_partial_flush ()
11601147
11611148 @TracerTestCase .run_in_subprocess (
1162- env_overrides = dict (DD_TRACER_PARTIAL_FLUSH_ENABLED = "true" , DD_TRACER_PARTIAL_FLUSH_MIN_SPANS = "1" )
1149+ env_overrides = dict (DD_TRACE_PARTIAL_FLUSH_ENABLED = "true" , DD_TRACE_PARTIAL_FLUSH_MIN_SPANS = "1" )
11631150 )
11641151 def test_partial_flush_too_many (self ):
11651152 root = self .tracer .trace ("root" )
@@ -1180,7 +1167,7 @@ def test_partial_flush_too_many(self):
11801167 assert traces [0 ][0 ].name == "root"
11811168
11821169 @TracerTestCase .run_in_subprocess (
1183- env_overrides = dict (DD_TRACER_PARTIAL_FLUSH_ENABLED = "true" , DD_TRACER_PARTIAL_FLUSH_MIN_SPANS = "6" )
1170+ env_overrides = dict (DD_TRACE_PARTIAL_FLUSH_ENABLED = "true" , DD_TRACE_PARTIAL_FLUSH_MIN_SPANS = "6" )
11841171 )
11851172 def test_partial_flush_too_few (self ):
11861173 root = self .tracer .trace ("root" )
@@ -1207,12 +1194,35 @@ def test_partial_flush_too_few_configure(self):
12071194 self .test_partial_flush_too_few ()
12081195
12091196 @TracerTestCase .run_in_subprocess (
1210- env_overrides = dict (DD_TRACER_PARTIAL_FLUSH_ENABLED = "false" , DD_TRACER_PARTIAL_FLUSH_MIN_SPANS = "6" )
1197+ env_overrides = dict (DD_TRACE_PARTIAL_FLUSH_ENABLED = "false" , DD_TRACE_PARTIAL_FLUSH_MIN_SPANS = "6" )
12111198 )
12121199 def test_partial_flush_configure_precedence (self ):
12131200 self .tracer .configure (partial_flush_enabled = True , partial_flush_min_spans = 5 )
12141201 self .test_partial_flush ()
12151202
1203+ @TracerTestCase .run_in_subprocess (
1204+ env_overrides = dict (DD_TRACER_PARTIAL_FLUSH_ENABLED = "true" , DD_TRACER_PARTIAL_FLUSH_MIN_SPANS = "5" )
1205+ )
1206+ def test_enable_partial_flush_with_deprecated_config (self ):
1207+ # Test tracer with deprecated configs D_TRACER_...
1208+ self ._test_partial_flush ()
1209+
1210+ def _test_partial_flush (self ):
1211+ root = self .tracer .trace ("root" )
1212+ for i in range (5 ):
1213+ self .tracer .trace ("child%s" % i ).finish ()
1214+
1215+ traces = self .pop_traces ()
1216+ assert len (traces ) == 1
1217+ assert len (traces [0 ]) == 5
1218+ assert [s .name for s in traces [0 ]] == ["child0" , "child1" , "child2" , "child3" , "child4" ]
1219+
1220+ root .finish ()
1221+ traces = self .pop_traces ()
1222+ assert len (traces ) == 1
1223+ assert len (traces [0 ]) == 1
1224+ assert traces [0 ][0 ].name == "root"
1225+
12161226
12171227def test_unicode_config_vals ():
12181228 t = ddtrace .Tracer ()
0 commit comments