The GitHub Actions job "Required Checks" on texera.git/main has succeeded.
Run started by GitHub user Yicong-Huang (triggered by Yicong-Huang).

Head commit for run:
0c5681989fae462ec38fef9a510bb28380b3ea88 / Yicong Huang 
<[email protected]>
test(pyamber): add unit tests for Heartbeat (#4704)

### What changes were proposed in this PR?

Adds pytest coverage for
`amber/src/main/python/core/runnables/heartbeat.py`. `stop()` is
intentionally not exercised — it sends `SIGTERM` to the test runner —
and `run()` is only verified on the early-exit branch (a pre-set stop
event).

### Any related issues, documentation, discussions?

Closes #4703.

Potential bug noted while reading the module (not pinned by these
tests): `_check_heartbeat`'s try/except wraps both the
`create_connection` and the subsequent `temp_socket.close()`. If
`close()` raises after a successful connect, the method logs "Server is
down" and returns `False` even though the JVM is reachable. The
double-check in `run()` masks transient occurrences but it is still
misleading. Worth deciding whether to narrow the try/except to the
connect call only.

### How was this PR tested?

```
cd amber/src/main/python
ruff check core/runnables/test_heartbeat.py
ruff format --check core/runnables/test_heartbeat.py
python -m pytest core/runnables/test_heartbeat.py
```

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (claude-opus-4-7)

Report URL: https://github.com/apache/texera/actions/runs/25267124754

With regards,
GitHub Actions via GitBox

Reply via email to