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

Head commit for run:
e99577bcb2d2613a7435dc389a7bcdca040aa3f4 / Yicong Huang 
<[email protected]>
test(pyamber): add unit tests for update_executor logic (#4719)

### What changes were proposed in this PR?

Adds pytest coverage for `ExecutorManager.update_executor` (extending
the existing `test_executor_manager.py`) and the `UpdateExecutorHandler`
that wraps it (new `test_update_executor_handler.py`).

### Any related issues, documentation, discussions?

Closes #4718.

Test-isolation note (not pinned by these tests): the existing
`executor_manager` fixture has a buggy cleanup guard — `if
hasattr(manager, "_fs"): manager.close()` checks for `_fs` but the
`cached_property` actually stores under `fs`, so `close()` is never
invoked. Combined with the fact that every fresh `ExecutorManager`
resets `executor_version` to 0 and thus reuses the module name `udf-v1`,
this leaves stale modules in `sys.modules` with paths that point at
deleted tmp dirs from earlier tests. The new `TestUpdateExecutor`
therefore avoids asserting on the *class* of the loaded executor and
instead checks dict-state preservation via setattr/getattr, so it works
regardless of which cached `udf-v1` happens to satisfy the import. A
separate fix would untangle the cleanup guard and probably move version
numbering off of the per-manager counter.

### How was this PR tested?

```
cd amber/src/main/python
ruff check core/architecture/managers/test_executor_manager.py 
core/architecture/handlers/control/test_update_executor_handler.py
ruff format --check core/architecture/managers/test_executor_manager.py 
core/architecture/handlers/control/test_update_executor_handler.py
python -m pytest core/architecture/managers/test_executor_manager.py 
core/architecture/handlers/control/test_update_executor_handler.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/25270842224

With regards,
GitHub Actions via GitBox

Reply via email to