Skip to content

Java APX CpuBurner: Integration Test#81

Closed
jaidev17 wants to merge 14 commits into
arm:mainfrom
jaidev17:feature/apx-java-hotspots-test
Closed

Java APX CpuBurner: Integration Test#81
jaidev17 wants to merge 14 commits into
arm:mainfrom
jaidev17:feature/apx-java-hotspots-test

Conversation

@jaidev17
Copy link
Copy Markdown
Contributor

@jaidev17 jaidev17 commented May 6, 2026

  • Prepare and compile CpuBurner on the runner for the APX Java hotspot test.
  • Simplify Java APX workload command in mcp-local/tests/constants.py.
  • Extend APX Java response wait and socket timeout to avoid premature timeouts.
  • Add success criteria: CpuBurner::workC must appear in Java hotspots.
  • Improve APX run_id parsing to handle multi-line JSON output.

jaidev17 added 14 commits April 21, 2026 16:42
…tput

The previous implementation hardcoded line index 1, which failed for the
Java workload where APX may emit the run_id JSON on a different line or
where _combine_command_output inserts [stderr] content between lines.

Now scans all JSON-looking lines (same pattern as _extract_session_id),
returning the first one that contains a valid run_id.
The cp /tmp/CpuBurnerOriginal.java approach failed because the file is
not present on the remote target at workload execution time - it was only
copied to the runner host, not the SSH target. The original base64 inline
approach is self-contained and does not depend on any pre-staged files.

Also removes the now-unnecessary workflow steps that copied the Java file
to the runner and /tmp.
Copilot AI review requested due to automatic review settings May 6, 2026 19:19
@jaidev17 jaidev17 changed the title Java APX CpuBurner: Java APX CpuBurner: Integration Test May 6, 2026
@jaidev17 jaidev17 closed this May 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Prepares a Java CpuBurner workload on the GitHub Actions runner and extends the existing MCP integration tests to validate APX Java “code_hotspots” output (including stricter success criteria), while also making APX run_id extraction more robust to noisy/multi-line CLI output.

Changes:

  • Install a JDK on the runner and compile a Java CpuBurner workload for APX hotspot testing.
  • Add a new MCP integration test request for APX Java hotspots and extend socket/response timeouts.
  • Improve APX run_id parsing by scanning output lines for JSON objects.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
mcp-local/utils/apx.py Updates APX run_id extraction logic to parse JSON from multi-line output.
mcp-local/tests/test_mcp.py Adds an integration test for APX Java hotspots with extended timeouts and a CpuBurner::workC presence check.
mcp-local/tests/CpuBurnerOriginal.java Introduces a Java CPU-burning workload used by the APX hotspots test.
mcp-local/tests/constants.py Adds a new apx_recipe_run request payload for the Java CpuBurner hotspots test.
.github/workflows/integration-tests.yml Installs JDK and compiles CpuBurner on the runner before running integration tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +252 to +262
java_rows = apx_java_structured.get("rows", [])
if java_rows:
workc_found = False
for row in java_rows:
if not isinstance(row, dict):
continue
function_name = row.get("FUNCTION_NAME") or row.get("function_name") or ""
if "CpuBurner::workC" in str(function_name):
workc_found = True
break
assert workc_found, "Test Failed: Expected CpuBurner::workC in APX Java hotspots output."
"arguments": {
"cmd": "java -XX:+PreserveFramePointer -cp /home/apxci/cpuburner CpuBurner 30",
"remote_ip_addr": "localhost",
"remote_usr": "base",
Comment thread mcp-local/utils/apx.py
Comment on lines 533 to +542
def extract_run_id(output: str) -> str:
if not output:
return ""
try:
data = json.loads(output.split("\n")[1])
return data.get("data", {}).get("run_id", {})
except Exception:
return ""
candidates = [line.strip() for line in output.splitlines() if line.strip().startswith("{")]
for candidate in candidates:
try:
data = json.loads(candidate)
run_id = data.get("data", {}).get("run_id")
if run_id:
return run_id
@@ -0,0 +1,199 @@
// CpuBurner.java
// Orignal un-optimised version workC function is deliberately slow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants