Yicong-Huang opened a new pull request, #4795:
URL: https://github.com/apache/texera/pull/4795

   ### What changes were proposed in this PR?
   
   Adds pytest coverage for two thin core utilities:
   
   - `amber/src/main/python/core/util/console_message/replace_print.py` — the 
`replace_print` context manager that intercepts `builtins.print` and enqueues 
`ConsoleMessage` payloads on a buffer.
   - `amber/src/main/python/core/util/thread/atomic.py` — the `AtomicInteger` 
thread-safe counter.
   
   ### Any related issues, documentation, discussions?
   
   Closes #4793.
   
   Bug pinned in the spec with comment + xfail-strict for the intended contract 
(filed separately as a Bug issue): `AtomicInteger.get_and_set` deadlocks 
because it holds the non-reentrant lock while invoking the `value` property, 
which tries to acquire the same lock again. The pinned test surfaces the 
deadlock via a thread + timeout (so the suite does not hang), and the 
xfail-strict companion asserts the intended `get_and_set` contract — that test 
will flip to XPASS the moment the deadlock is fixed and force the spec to be 
updated alongside.
   
   ### How was this PR tested?
   
   ```
   cd amber/src/main/python
   ruff check core/util/thread/test_atomic.py 
core/util/console_message/test_replace_print.py
   ruff format --check core/util/thread/test_atomic.py 
core/util/console_message/test_replace_print.py
   python -m pytest core/util/thread/test_atomic.py 
core/util/console_message/test_replace_print.py
   ```
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (claude-opus-4-7)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to