You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "aglinxinyuan (via GitHub)" <gi...@apache.org> on 2026/08/27 11:46:17 UTC
[PR] test(pyamber): cover the statistics and pause managers [texera]
aglinxinyuan opened a new pull request, #8049:
URL: https://github.com/apache/texera/pull/8049
### What changes were proposed in this PR?
Two manager specs extended, 19 tests to 27.
| File | Codecov fully-covered | Branch arms |
|---|---|---|
| `statistics_manager.py` | 41/45 → **45/45** | 12/14 → **14/14** |
| `pause_manager.py` | 42/45 → **45/45** | 12/14 → **14/14** |
**+7 fully-covered lines and +4 branch arms. Both files reach 100% on lines and branches.**
`statistics_manager.py`'s gap was `94: 50% (1/2)`, `95: MISS`, `101: 50% (1/2)`, `102: MISS` — the arms deciding whether an input or output statistics update is recorded at all. `pause_manager.py`'s was the channel pause/resume paths, including both `change_state=False` variants and the global-pause queue cycle.
**Two files were dropped from this bundle on measurement:** `state_manager.py` (1 line) and `linked_blocking_multi_queue.py`, whose four partial lines did not survive scrutiny despite its 78 branch arms. `core/util/customized_queue/inner.py` sits in the same package and shows 2 partials plus 5 missed lines, but it is **vendored third-party code** and was refused rather than counted.
### Verification
Two reviewers returned **eleven** findings — the most of any bundle in this batch. The builder had reported `survivors: []`, which the reviewers showed was materially wrong.
**46 mutations were run one at a time against the final tree; 44 die, and 15 of those die at exactly one test each.** The two that survive are reported rather than dropped, both genuinely equivalent:
- Exchanging the `.add(channel_id)` and `disable(channel_id)` statements inside `pause_input_channel` — both statements are individually pinned by separate tests, so the order is unobservable.
- Replacing the guarded `remove` with `discard` — `discard` is by definition `remove if present`.
Measured from `amber/` with the identical full-suite scope on both sides and `--cov-branch` passed explicitly, since this branch is on `main` and `amber/pyproject.toml` has no `[tool.coverage.run]` section (verified by reading it: only the three `ruff` tables and `pytest.ini_options` exist). Per-line `hits` and `condition-coverage` were read out of `coverage.xml` by a parser script; summary percentages ignored. The before-state was produced by writing the `HEAD` content of the two test files into the tree from a scratch extraction and restoring the new versions from a scratch snapshot afterwards, sha256-verified. **No `git restore` or `git checkout` was run on any file.**
Full pyamber suite: `5 failed, 1167 passed, 7 errors` against main's `1159 passed`. Failure sets sorted and diffed — **identical by identity**, 12 entries. `ruff check` and `ruff format --check` pass on CI's exact scope.
No production file is touched; `git diff -- 'amber/src/main/*'` is empty.
### Any related issues, documentation, discussions?
Closes #8045
### How was this PR tested?
```
cd amber && python -m pytest -m "not integration" -q src/test/python/core/architecture/managers
```
```
27 passed
```
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(pyamber): cover the statistics and pause managers [texera]
Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan merged PR #8049:
URL: https://github.com/apache/texera/pull/8049
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(pyamber): cover the statistics and pause managers [texera]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #8049:
URL: https://github.com/apache/texera/pull/8049#issuecomment-5439184498
## [Codecov](https://app.codecov.io/gh/apache/texera/pull/8049?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 93.42%. Comparing base ([`b01b11f`](https://app.codecov.io/gh/apache/texera/commit/b01b11f8182313b9f3bff877c661f7ae0f0b5a1c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`bc43983`](https://app.codecov.io/gh/apache/texera/commit/bc4398374c3372fed9ae54a0bb5f1ca8c1189fd7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:white_check_mark: All tests successful. No failed tests found.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #8049 +/- ##
=========================================
Coverage 93.41% 93.42%
Complexity 4696 4696
=========================================
Files 1179 1179
Lines 47713 47713
Branches 5314 5314
=========================================
+ Hits 44573 44576 +3
+ Misses 1698 1695 -3
Partials 1442 1442
```
| [Flag](https://app.codecov.io/gh/apache/texera/pull/8049/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | *Carryforward flag |
|---|---|---|---|
| [access-control-service](https://app.codecov.io/gh/apache/texera/pull/8049/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.00% <ø> (ø)` | | Carriedforward from [b01b11f](https://app.codecov.io/gh/apache/texera/commit/b01b11f8182313b9f3bff877c661f7ae0f0b5a1c?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [agent-service](https://app.codecov.io/gh/apache/texera/pull/8049/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `99.32% <ø> (ø)` | | Carriedforward from [b01b11f](https://app.codecov.io/gh/apache/texera/commit/b01b11f8182313b9f3bff877c661f7ae0f0b5a1c?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [amber](https://app.codecov.io/gh/apache/texera/pull/8049/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `89.60% <ø> (ø)` | | Carriedforward from [b01b11f](https://app.codecov.io/gh/apache/texera/commit/b01b11f8182313b9f3bff877c661f7ae0f0b5a1c?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/8049/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.67% <ø> (ø)` | | Carriedforward from [b01b11f](https://app.codecov.io/gh/apache/texera/commit/b01b11f8182313b9f3bff877c661f7ae0f0b5a1c?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [config-service](https://app.codecov.io/gh/apache/texera/pull/8049/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `86.73% <ø> (ø)` | | Carriedforward from [b01b11f](https://app.codecov.io/gh/apache/texera/commit/b01b11f8182313b9f3bff877c661f7ae0f0b5a1c?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [file-service](https://app.codecov.io/gh/apache/texera/pull/8049/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `86.70% <ø> (ø)` | | Carriedforward from [b01b11f](https://app.codecov.io/gh/apache/texera/commit/b01b11f8182313b9f3bff877c661f7ae0f0b5a1c?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [frontend](https://app.codecov.io/gh/apache/texera/pull/8049/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `95.89% <ø> (ø)` | | Carriedforward from [b01b11f](https://app.codecov.io/gh/apache/texera/commit/b01b11f8182313b9f3bff877c661f7ae0f0b5a1c?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [notebook-migration-service](https://app.codecov.io/gh/apache/texera/pull/8049/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `79.31% <ø> (ø)` | | Carriedforward from [b01b11f](https://app.codecov.io/gh/apache/texera/commit/b01b11f8182313b9f3bff877c661f7ae0f0b5a1c?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [pyamber](https://app.codecov.io/gh/apache/texera/pull/8049/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `97.85% <ø> (+0.06%)` | :arrow_up: | |
| [workflow-compiling-service](https://app.codecov.io/gh/apache/texera/pull/8049/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.19% <ø> (ø)` | | Carriedforward from [b01b11f](https://app.codecov.io/gh/apache/texera/commit/b01b11f8182313b9f3bff877c661f7ae0f0b5a1c?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
*This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/texera/pull/8049?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(pyamber): cover the statistics and pause managers [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8049:
URL: https://github.com/apache/texera/pull/8049#issuecomment-5438896527
<!-- texera-reviewer-suggestion -->
### Automated Reviewer Suggestions
Based on the `git blame` history of the changed files, we recommend the following reviewers:
- **Contributors with relevant context:** `@Yicong-Huang`, `@Ma77Ball`
You can notify them by mentioning `@Yicong-Huang`, `@Ma77Ball` in a comment.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(pyamber): cover the statistics and pause managers [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #8049:
URL: https://github.com/apache/texera/pull/8049#discussion_r3875519298
##########
amber/src/test/python/core/architecture/managers/test_pause_manager.py:
##########
@@ -72,3 +75,132 @@ def test_it_can_be_resumed_when_resumed(self, pause_manager):
assert not pause_manager.is_paused()
pause_manager.resume(PauseType.USER_PAUSE)
assert not pause_manager.is_paused()
+
+ @staticmethod
+ def _register_channel(input_queue, name: str) -> ChannelIdentity:
+ """A channel only gets a sub-queue once something is enqueued on it, so
+ go through the production put() path before pausing it."""
+ channel = ChannelIdentity(
+ ActorVirtualIdentity(name), ActorVirtualIdentity("self"), False
+ )
+ input_queue.put(DataElement(tag=channel, payload=DataPayload()))
+ return channel
+
+ def test_resume_of_one_type_keeps_worker_paused_while_another_is_held(
+ self, pause_manager, state_manager
+ ):
+ # Two independent global pause holders. Releasing one must not resume
+ # the worker -- resume() returns early while any global pause remains.
+ pause_manager.pause(PauseType.USER_PAUSE)
+ pause_manager.pause(PauseType.DEBUG_PAUSE)
+ assert state_manager.confirm_state(WorkerState.PAUSED)
+
+ pause_manager.resume(PauseType.USER_PAUSE)
+ assert pause_manager.is_paused()
+ assert state_manager.confirm_state(WorkerState.PAUSED)
+
+ # resume() must release the type it was ASKED for, not just some
+ # arbitrary holder: repeating the release of the already-released
+ # USER_PAUSE is a no-op, and DEBUG_PAUSE still holds the worker.
+ # Without this, `resume(X)` popping an arbitrary element off the pause
+ # set is indistinguishable from popping X -- and an EXCEPTION_PAUSE
+ # released by a user resume would silently restart a failed worker.
+ pause_manager.resume(PauseType.USER_PAUSE)
+ assert pause_manager.is_paused()
+ assert state_manager.confirm_state(WorkerState.PAUSED)
+
+ # Releasing the last holder does resume.
+ pause_manager.resume(PauseType.DEBUG_PAUSE)
+ assert not pause_manager.is_paused()
+ assert state_manager.confirm_state(WorkerState.RUNNING)
+
+ def test_global_pause_closes_the_data_queue_and_resume_reopens_it(
+ self, pause_manager, input_queue
+ ):
+ # pause()/resume() gate the data queues wholesale, keyed by
+ # DISABLE_BY_PAUSE. The channel is registered BEFORE the pause, which
+ # is what makes the blanket disable observable at all: disable_data()
+ # only iterates the sub-queues that exist when it runs, so a test that
+ # registers afterwards cannot see it. Re-enabling under the wrong
+ # DisableType key would leave a resumed worker's data queue shut for
+ # good, i.e. a hang.
+ self._register_channel(input_queue, "up")
+ assert input_queue.is_data_enabled()
+
+ pause_manager.pause(PauseType.USER_PAUSE)
+ assert not input_queue.is_data_enabled()
+
+ pause_manager.resume(PauseType.USER_PAUSE)
+ assert input_queue.is_data_enabled()
+
+ def test_channel_pause_blocks_the_global_resume(
+ self, pause_manager, state_manager, input_queue
+ ):
+ # A per-channel pause outlives the global one: once the global pause is
+ # released the pause set is empty, but a channel is still held, so the
+ # blanket data re-enable and the PAUSED -> RUNNING transition are both
+ # skipped. Note the channel is registered AFTER pause(), so pause()'s
+ # own disable_data() found no sub-queues and did nothing here -- the
+ # channel is closed only by pause_input_channel below.
+ pause_manager.pause(PauseType.USER_PAUSE)
+ channel = self._register_channel(input_queue, "up")
+ pause_manager.pause_input_channel(PauseType.DEBUG_PAUSE, channel)
+ assert state_manager.confirm_state(WorkerState.PAUSED)
+ assert not input_queue.is_data_enabled()
+
+ pause_manager.resume(PauseType.USER_PAUSE)
+ assert state_manager.confirm_state(WorkerState.PAUSED)
+ # The blanket re-enable really is skipped, not merely state-neutral.
+ assert not input_queue.is_data_enabled()
+
+ # Releasing the channel pause finally resumes.
+ pause_manager.resume(PauseType.DEBUG_PAUSE)
+ assert state_manager.confirm_state(WorkerState.RUNNING)
+ assert input_queue.is_data_enabled()
+
+ def test_releasing_one_channel_pause_reopens_that_channel(
+ self, pause_manager, input_queue
+ ):
+ # Two channels held by two DIFFERENT pause types, and no global pause.
+ # Releasing one type leaves the other still holding, so resume()
+ # returns before the blanket enable_data() at the end of the method --
+ # which means the released channel can only be open again because
+ # resume() re-enabled it channel by channel. In the sibling test above,
+ # that blanket enable masks the per-channel work entirely.
+ first = self._register_channel(input_queue, "first")
+ second = self._register_channel(input_queue, "second")
+ pause_manager.pause_input_channel(PauseType.DEBUG_PAUSE, first)
+ # ECM_PAUSE is the type main_loop actually uses for channel pauses.
+ pause_manager.pause_input_channel(PauseType.ECM_PAUSE, second)
+ assert not input_queue.is_data_enabled()
+
+ pause_manager.resume(PauseType.DEBUG_PAUSE)
+ assert input_queue.is_data_enabled()
Review Comment:
`is_data_enabled()` returns `any(self._queue.is_enabled(...))` for data channels, so this assertion can pass even if `resume(PauseType.DEBUG_PAUSE)` re-enables the wrong channel (or blanket-enables data) while the ECM-paused channel is incorrectly reopened. Since the test name/comment are about reopening the released channel while the other remains paused, consider asserting per-channel enablement/disablement instead.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(pyamber): cover the statistics and pause managers [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8049:
URL: https://github.com/apache/texera/pull/8049#issuecomment-5439422681
<!-- texera-benchmarks-comment -->
## ⚠️ Benchmark changes need a look
🟢 2 better · 🔴 5 worse · ⚪ 8 noise (<±5%) · 0 without baseline
> Compared against main `b01b11f` benchmarked on **this same runner**, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.
[Dashboard](https://apache.github.io/texera/dev/bench/) · [Run](https://github.com/apache/texera/actions/runs/33068847930)
| | config | throughput | MB/s | latency | max Δ latest / 7d |
|---|---|---:|---:|---:|---:|
| 🟢 | bs=10 sw=10 sl=64 | 635 | 0.387 | 14,624/19,925/19,925 us | 🟢 -18.3% / 🔴 +43.9% |
| 🔴 | bs=100 sw=10 sl=64 | 1,247 | 0.761 | 78,182/115,015/115,015 us | 🔴 +26.2% / 🔴 +22.8% |
| ⚪ | bs=1000 sw=10 sl=64 | 1,497 | 0.914 | 665,053/746,901/746,901 us | ⚪ within ±5% / 🟢 +25.0% |
<details><summary>Baseline details</summary>
Latest main `b01b11f` from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---:|---:|---:|---:|---:|
| bs=10 sw=10 sl=64 | throughput | 635 tuples/sec | 629 tuples/sec | 894.86 tuples/sec | +1.0% | -29.0% |
| bs=10 sw=10 sl=64 | MB/s | 0.387 MB/s | 0.384 MB/s | 0.546 MB/s | +0.8% | -29.1% |
| bs=10 sw=10 sl=64 | p50 | 14,624 us | 14,493 us | 11,139 us | +0.9% | +31.3% |
| bs=10 sw=10 sl=64 | p95 | 19,925 us | 24,382 us | 13,843 us | -18.3% | +43.9% |
| bs=10 sw=10 sl=64 | p99 | 19,925 us | 24,382 us | 16,839 us | -18.3% | +18.3% |
| bs=100 sw=10 sl=64 | throughput | 1,247 tuples/sec | 1,385 tuples/sec | 1,166 tuples/sec | -10.0% | +7.0% |
| bs=100 sw=10 sl=64 | MB/s | 0.761 MB/s | 0.845 MB/s | 0.711 MB/s | -9.9% | +7.0% |
| bs=100 sw=10 sl=64 | p50 | 78,182 us | 70,556 us | 87,509 us | +10.8% | -10.7% |
| bs=100 sw=10 sl=64 | p95 | 115,015 us | 91,159 us | 93,675 us | +26.2% | +22.8% |
| bs=100 sw=10 sl=64 | p99 | 115,015 us | 91,159 us | 102,153 us | +26.2% | +12.6% |
| bs=1000 sw=10 sl=64 | throughput | 1,497 tuples/sec | 1,494 tuples/sec | 1,198 tuples/sec | +0.2% | +24.9% |
| bs=1000 sw=10 sl=64 | MB/s | 0.914 MB/s | 0.912 MB/s | 0.731 MB/s | +0.2% | +25.0% |
| bs=1000 sw=10 sl=64 | p50 | 665,053 us | 668,195 us | 859,766 us | -0.5% | -22.6% |
| bs=1000 sw=10 sl=64 | p95 | 746,901 us | 725,298 us | 902,897 us | +3.0% | -17.3% |
| bs=1000 sw=10 sl=64 | p99 | 746,901 us | 725,298 us | 937,957 us | +3.0% | -20.4% |
</details>
<details><summary>Raw CSV</summary>
```csv
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,315.07,200,128000,635,0.387,14624.16,19924.98,19924.98
1,100,10,64,20,1603.69,2000,1280000,1247,0.761,78182.20,115014.82,115014.82
2,1000,10,64,20,13360.60,20000,12800000,1497,0.914,665053.27,746901.03,746901.03
```
</details>
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org