11import pytest
22from utils .parametric .spec .trace import find_span , find_trace
33from utils import missing_feature , features , context , scenarios
4+ from utils .docker_fixtures import TestAgentAPI
5+ from .conftest import APMLibrary
46
57
68@features .partial_flush
@@ -12,7 +14,7 @@ class Test_Partial_Flushing:
1214 @missing_feature (
1315 context .library == "java" , reason = "java uses '>' so it needs one more span to force a partial flush"
1416 )
15- def test_partial_flushing_one_span (self , test_agent , test_library ):
17+ def test_partial_flushing_one_span (self , test_agent : TestAgentAPI , test_library : APMLibrary ):
1618 """Create a trace with a root span and a single child. Finish the child, and ensure
1719 partial flushing triggers. This test explicitly enables partial flushing.
1820 """
@@ -24,7 +26,7 @@ def test_partial_flushing_one_span(self, test_agent, test_library):
2426 )
2527 @missing_feature (context .library == "golang" , reason = "partial flushing not enabled by default" )
2628 @missing_feature (context .library == "dotnet" , reason = "partial flushing not enabled by default" )
27- def test_partial_flushing_one_span_default (self , test_agent , test_library ):
29+ def test_partial_flushing_one_span_default (self , test_agent : TestAgentAPI , test_library : APMLibrary ):
2830 """Create a trace with a root span and a single child. Finish the child, and ensure
2931 partial flushing triggers. This test assumes partial flushing is enabled by default.
3032 """
@@ -33,7 +35,7 @@ def test_partial_flushing_one_span_default(self, test_agent, test_library):
3335 @pytest .mark .parametrize (
3436 "library_env" , [{"DD_TRACE_PARTIAL_FLUSH_MIN_SPANS" : "5" , "DD_TRACE_PARTIAL_FLUSH_ENABLED" : "true" }]
3537 )
36- def test_partial_flushing_under_limit_one_payload (self , test_agent , test_library ):
38+ def test_partial_flushing_under_limit_one_payload (self , test_agent : TestAgentAPI , test_library : APMLibrary ):
3739 """Create a trace with a root span and a single child. Finish the child, and ensure
3840 partial flushing does NOT trigger, since the partial flushing min spans is set to 5.
3941 """
@@ -42,13 +44,13 @@ def test_partial_flushing_under_limit_one_payload(self, test_agent, test_library
4244 @pytest .mark .parametrize (
4345 "library_env" , [{"DD_TRACE_PARTIAL_FLUSH_MIN_SPANS" : "1" , "DD_TRACE_PARTIAL_FLUSH_ENABLED" : "false" }]
4446 )
45- def test_partial_flushing_disabled (self , test_agent , test_library ):
47+ def test_partial_flushing_disabled (self , test_agent : TestAgentAPI , test_library : APMLibrary ):
4648 """Create a trace with a root span and a single child. Finish the child, and ensure
4749 partial flushing does NOT trigger, since it's explicitly disabled.
4850 """
4951 self .no_partial_flush_test (test_agent , test_library )
5052
51- def do_partial_flush_test (self , test_agent , test_library ):
53+ def do_partial_flush_test (self , test_agent : TestAgentAPI , test_library : APMLibrary ):
5254 """Create a trace with a root span and a single child. Finish the child, and ensure
5355 partial flushing triggers.
5456 """
@@ -70,7 +72,7 @@ def do_partial_flush_test(self, test_agent, test_library):
7072 assert len (traces ) == 1
7173 assert root_span ["name" ] == "root"
7274
73- def no_partial_flush_test (self , test_agent , test_library ):
75+ def no_partial_flush_test (self , test_agent : TestAgentAPI , test_library : APMLibrary ):
7476 """Create a trace with a root span and one child. Finish the child, and ensure
7577 partial flushing does NOT trigger.
7678 """
0 commit comments