aglinxinyuan opened a new pull request, #5555: URL: https://github.com/apache/texera/pull/5555
### What changes were proposed in this PR? Pin behavior of two utility modules in `engine/common`. No production-code changes. | Spec | Source class | Tests | | --- | --- | --- | | `FutureBijectionSpec` | `FutureBijection` | 11 | | `ElidableStatementSpec` | `ElidableStatement` | 9 | Both spec files follow the `<srcClassName>Spec.scala` one-to-one convention. **Behavior pinned — `FutureBijection`** | Surface | Contract | | --- | --- | | `TwitterFuture.value.asScala` | resolves to the same value (type preserved, `null` preserved) | | `TwitterFuture.exception.asScala` | resolves with the same `Throwable` instance (type, message, `eq` identity) | | `ScalaFuture.successful.asTwitter` | resolves to the same value (type preserved, `null` preserved) | | `ScalaFuture.failed.asTwitter` | resolves with the same `Throwable` instance | | Twitter → Scala on an already-resolved future | the resulting Scala future is already completed when the implicit returns | | Twitter → Scala → Twitter round-trip | preserves both values and exceptions | | Scala → Twitter → Scala round-trip | preserves values | **Behavior pinned — `ElidableStatement`** The texera build sets `-Xelide-below WARNING` (`amber/build.sbt`). Every `ElidableStatement` helper is annotated with an elide level **strictly below WARNING** (FINEST / FINER / FINE / INFO), so the Scala compiler replaces every CALL to these helpers with a `()` Unit value at *compile* time. The spec pins this silent-in-production contract: | Surface | Contract | | --- | --- | | `info` / `fine` / `finer` / `finest` (with side-effect block) | the side effect MUST NOT fire (counter stays at 0) | | same methods (with throwing block) | the exception MUST NOT propagate | | 1000 successive elided calls | no side-effect accumulation | | Return type | `Unit` (compile-time enforced) | | Parameter shape | accepts a `=> Unit` by-name block (compile-time enforced) | A regression that bumped a method's elide level above WARNING, removed the `@elidable` annotation, or relaxed `-Xelide-below` in the build would re-enable side effects in production — and this spec would catch it. ### Any related issues, documentation, discussions? Closes #5551. ### How was this PR tested? Pure unit-test additions; verified locally with: - `sbt "WorkflowExecutionService/testOnly org.apache.texera.amber.engine.common.FutureBijectionSpec org.apache.texera.amber.engine.common.ElidableStatementSpec"` — 20 tests, all green - `sbt scalafmtCheckAll` — clean - CI to confirm ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Sonnet 4.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]
