Skip to content

Commit 46957e1

Browse files
committed
fix: update java tracer unit tests for reduced Workload fixture
Remove assertions for filterEvens and instanceMethod which were removed from the Workload fixture. Adjust expected invocation counts accordingly.
1 parent 21f61ec commit 46957e1

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

tests/test_languages/test_java/test_java_tracer_e2e.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,12 @@ 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) >= 3, f"Expected at least 3 captured invocations, got {len(rows)}"
8585

8686
# Check that specific methods were captured
8787
functions = {row[0] for row in rows}
8888
assert "computeSum" in functions
8989
assert "repeatString" in functions
90-
assert "filterEvens" in functions
91-
assert "instanceMethod" in functions
9290

9391
# Verify all rows have non-empty args blobs
9492
for row in rows:
@@ -97,7 +95,7 @@ def test_agent_captures_invocations(self, compiled_workload: Path, trace_db: Pat
9795
# Verify metadata
9896
metadata = dict(conn.execute("SELECT key, value FROM metadata").fetchall())
9997
assert "totalCaptures" in metadata
100-
assert int(metadata["totalCaptures"]) >= 5
98+
assert int(metadata["totalCaptures"]) >= 3
10199
finally:
102100
conn.close()
103101

@@ -136,7 +134,7 @@ def test_max_function_count_limit(self, compiled_workload: Path, trace_db: Path)
136134

137135
conn = sqlite3.connect(str(trace_db))
138136
try:
139-
# computeSum is called 4 times (2 direct + 2 from instanceMethod)
137+
# computeSum is called 2 times (direct calls in main)
140138
compute_count = conn.execute(
141139
"SELECT COUNT(*) FROM function_calls WHERE function = 'computeSum'"
142140
).fetchone()[0]
@@ -296,7 +294,7 @@ def test_full_trace_and_replay_generation(self, compiled_workload: Path, tmp_pat
296294
assert len(workload_files) == 1
297295
content = workload_files[0].read_text(encoding="utf-8")
298296
assert "replay_computeSum" in content
299-
assert "replay_instanceMethod" in content
297+
assert "replay_repeatString" in content
300298

301299
def test_package_detection(self) -> None:
302300
"""Test that package detection finds Java packages from source files."""

0 commit comments

Comments
 (0)