aglinxinyuan opened a new pull request, #7903:
URL: https://github.com/apache/texera/pull/7903

   ### What changes were proposed in this PR?
   
   Two new specs for two files that had none. 15 tests.
   
   Measured with a per-suite `Tests.Filter`, one fresh sbt JVM per run, 
identical filters apart from the suite set.
   
   | File | Codecov | JaCoCo line-hit | Branch arms |
   |---|---|---|---|
   | `WorkerTimerService.scala` | 18/25 = 72.0% → **25/25 = 100%** | 20/25 → 
**25/25** | 4 covered / 4 missed → **8 / 0** |
   | `DatasetStatisticsUtils.scala` | 12/17 = 70.6% → **17/17 = 100%** | 12/17 
→ **17/17** | no branch instructions |
   
   Against Codecov's CI baseline that is **+10 fully-covered lines and +2 
branch arms.** The first draft claimed +12 lines and +4 arms; the line figure 
was qualified against CI and the arm figure was not, and +4 does not hold there.
   
   `ConfigParserUtil` was in the original scope and is absent: it already has a 
spec on main and needed nothing.
   
   ### Verification
   
   23 mutations, **20 killed, 3 survivors.**
   
   Four repairs are worth naming because the original tests pinned less than 
they appeared to:
   
   - A test credited with pinning the scheduler interval did not: both sides 
read `ApplicationConfig.adaptiveBatchingInterval`, so it was self-referential. 
It now asserts against the value the constructor captured, reachable only by 
reflection on a private final field.
   - Two resume tests **manufactured their precondition by writing production 
state** (`service.adaptiveBatchingHandle = None`) and then asserted that same 
value. Both writes are deleted; the tests now reach the precondition through 
the production API.
   - `Cancellable.cancel()`'s Boolean was never false anywhere in the suite, 
hiding a whole mutant class. The spec's own helper is now parameterised so the 
false path runs.
   - Every seeded dataset row was `isPublic=false` / `isDownloadable=true`, so 
two spurious-visibility mutants survived. Rows now vary both flags, with two 
owners, distinct names and distinct creation times.
   
   **Two reviewer suggestions were refused, both because they discriminate 
nothing** — and this was checked by running them, not argued. One proposed 
replacing a config accessor with a path read: under the very mutant the 
reviewer demonstrated, that read returns the same value and the observation is 
unchanged. The other proposed a start-then-pause sequence: under the mutant it 
targets, that sequence still ends with `isPaused = true`.
   
   **The survivors:**
   
   - Setting a `size` field to a constant inside a private mapping survives — 
the value is overwritten by its only caller's `copy(size = …)`. Equivalent, not 
a gap.
   - The wrong-config-key class is empty in the current configuration but **not 
closed in principle**: an `Int`-typed accessor holding exactly the same value 
would survive substitution.
   - Exchanging the two `SELF` arguments in `AsyncRPCContext(SELF, SELF)` is 
unkillable by construction, since both operands are the same value. Stated so 
it is not mistaken for a kill.
   
   ### A production defect, left unpinned on purpose
   
   `stopAdaptiveBatching` cancels the adaptive-batching handle without clearing 
it, so after a real start-then-pause, **`resumeAdaptiveBatching` cannot re-arm 
at all**. Adding the clear — the behaviour 
`CoordinatorTimerService.disableTimer` already has — is a production change and 
out of scope here.
   
   The consequence for reading this PR: line coverage on the resume path does 
**not** constrain pause/resume behaviour. The defect is left unpinned in both 
directions rather than asserted, so a fix will not have to fight a test that 
cemented it.
   
   Related: nothing in production reads `isPaused` — only the service itself — 
so the `isPaused` contract this spec pins is characterization, not 
specification. Said plainly rather than dressed up as a requirement.
   
   Both new spec files carry the Apache license header. No production file is 
touched.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7902
   
   ### How was this PR tested?
   
   ```
   sbt "WorkflowExecutionService/testOnly 
org.apache.texera.amber.engine.architecture.messaginglayer.WorkerTimerServiceSpec
 
org.apache.texera.web.resource.dashboard.user.dataset.utils.DatasetStatisticsUtilsSpec"
   ```
   
   ```
   [info] Total number of tests run: 15
   [info] Tests: succeeded 15, failed 0, canceled 0, ignored 0, pending 0
   ```
   
   `Test/scalafmtCheck` and `Test/scalafix --check` both pass.
   
   ### 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: [email protected]

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

Reply via email to