7
7
8
8
class TestColdStartTracingSetup (unittest .TestCase ):
9
9
def test_initialize_cold_start_tracing (self ):
10
+ cold_start ._cold_start = True
10
11
cold_start .initialize_cold_start_tracing () # testing double wrapping
12
+ cold_start ._cold_start = True
11
13
cold_start .initialize_cold_start_tracing ()
12
14
cold_start .reset_node_stacks ()
13
15
for module_name in ["ast" , "dis" , "inspect" ]:
@@ -22,6 +24,7 @@ def test_initialize_cold_start_tracing(self):
22
24
def test_bad_importer_find_spec_attribute_error (self ):
23
25
mock_importer = object () # AttributeError when accessing find_spec
24
26
meta_path .append (mock_importer )
27
+ cold_start ._cold_start = True
25
28
cold_start .initialize_cold_start_tracing () # safe to call
26
29
meta_path .pop ()
27
30
@@ -38,12 +41,13 @@ def find_spec(*args, **kwargs):
38
41
39
42
mock_importer .find_spec = find_spec
40
43
meta_path .append (mock_importer )
44
+ cold_start ._cold_start = True
41
45
cold_start .initialize_cold_start_tracing ()
42
46
self .assertFalse (mock_loader in cold_start .already_wrapped_loaders )
43
47
meta_path .pop ()
44
48
os .environ ["DD_COLD_START_TRACING" ] = "true"
45
49
46
- def xtest_exec_module_failure_case (self ):
50
+ def test_exec_module_failure_case (self ):
47
51
mock_importer = MagicMock ()
48
52
mock_module_spec = MagicMock ()
49
53
mock_module_spec .name = "test_name"
@@ -60,6 +64,7 @@ def find_spec(*args, **kwargs):
60
64
61
65
mock_importer .find_spec = find_spec
62
66
meta_path .insert (0 , mock_importer )
67
+ cold_start ._cold_start = True
63
68
cold_start .initialize_cold_start_tracing ()
64
69
cold_start .reset_node_stacks ()
65
70
try :
0 commit comments