@@ -81,14 +81,11 @@ def test_agent_captures_invocations(self, compiled_workload: Path, trace_db: Pat
8181 conn = sqlite3 .connect (str (trace_db ))
8282 try :
8383 rows = conn .execute ("SELECT function, classname, descriptor, length(args) FROM function_calls" ).fetchall ()
84- assert len (rows ) >= 5 , f"Expected at least 5 captured invocations, got { len (rows )} "
84+ assert len (rows ) >= 2 , f"Expected at least 2 captured invocations, got { len (rows )} "
8585
8686 # Check that specific methods were captured
8787 functions = {row [0 ] for row in rows }
88- assert "computeSum" in functions
8988 assert "repeatString" in functions
90- assert "filterEvens" in functions
91- assert "instanceMethod" in functions
9289
9390 # Verify all rows have non-empty args blobs
9491 for row in rows :
@@ -97,7 +94,7 @@ def test_agent_captures_invocations(self, compiled_workload: Path, trace_db: Pat
9794 # Verify metadata
9895 metadata = dict (conn .execute ("SELECT key, value FROM metadata" ).fetchall ())
9996 assert "totalCaptures" in metadata
100- assert int (metadata ["totalCaptures" ]) >= 5
97+ assert int (metadata ["totalCaptures" ]) >= 2
10198 finally :
10299 conn .close ()
103100
@@ -136,11 +133,11 @@ def test_max_function_count_limit(self, compiled_workload: Path, trace_db: Path)
136133
137134 conn = sqlite3 .connect (str (trace_db ))
138135 try :
139- # computeSum is called 4 times (2 direct + 2 from instanceMethod)
140- compute_count = conn .execute (
141- "SELECT COUNT(*) FROM function_calls WHERE function = 'computeSum '"
136+ # repeatString is called 1000+ times; with maxFunctionCount=2, at most 2 should be captured
137+ repeat_count = conn .execute (
138+ "SELECT COUNT(*) FROM function_calls WHERE function = 'repeatString '"
142139 ).fetchone ()[0 ]
143- assert compute_count <= 2 , f"Expected at most 2 computeSum captures, got { compute_count } "
140+ assert repeat_count <= 2 , f"Expected at most 2 repeatString captures, got { repeat_count } "
144141 finally :
145142 conn .close ()
146143
@@ -198,7 +195,6 @@ def test_generates_test_files(self, compiled_workload: Path, trace_db: Path, tmp
198195 assert "package codeflash.replay;" in content
199196 assert "import org.junit.jupiter.api.Test;" in content
200197 assert "ReplayHelper" in content
201- assert "replay_computeSum_0" in content
202198 assert "replay_repeatString_0" in content
203199
204200 def test_metadata_parsing (self , compiled_workload : Path , trace_db : Path , tmp_path : Path ) -> None :
@@ -243,7 +239,7 @@ def test_metadata_parsing(self, compiled_workload: Path, trace_db: Path, tmp_pat
243239 assert "functions" in metadata
244240 assert "trace_file" in metadata
245241 assert "classname" in metadata
246- assert "computeSum " in metadata ["functions" ]
242+ assert "repeatString " in metadata ["functions" ]
247243 assert metadata ["classname" ] == "com.example.Workload"
248244 assert metadata ["trace_file" ] == trace_db .as_posix ()
249245
@@ -267,7 +263,7 @@ def test_two_stage_trace(self, compiled_workload: Path, tmp_path: Path) -> None:
267263 conn = sqlite3 .connect (str (trace_db ))
268264 try :
269265 count = conn .execute ("SELECT COUNT(*) FROM function_calls" ).fetchone ()[0 ]
270- assert count >= 5 , f"Expected at least 5 captured invocations, got { count } "
266+ assert count >= 2 , f"Expected at least 2 captured invocations, got { count } "
271267 finally :
272268 conn .close ()
273269
@@ -295,8 +291,7 @@ def test_full_trace_and_replay_generation(self, compiled_workload: Path, tmp_pat
295291 workload_files = [f for f in test_files if "Workload" in f .name and "ConstructorAccess" not in f .name ]
296292 assert len (workload_files ) == 1
297293 content = workload_files [0 ].read_text (encoding = "utf-8" )
298- assert "replay_computeSum" in content
299- assert "replay_instanceMethod" in content
294+ assert "replay_repeatString" in content
300295
301296 def test_package_detection (self ) -> None :
302297 """Test that package detection finds Java packages from source files."""
0 commit comments