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/07/31 02:45:21 UTC

[PR] test(amber): cover workflow lifecycle cleanup [texera]

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

   ### What changes were proposed in this PR?
   
   Adds `WorkflowLifecycleManagerSpec` for the lifecycle manager's externally observable cleanup behavior.
   
   | Scenario | Observable contract |
   | --- | --- |
   | Multiple users | Cleanup waits until the final user disconnects. |
   | Workflow state | A RUNNING update cancels cleanup; a terminal update schedules it again. |
   | Repeated terminal updates | A later update replaces the older deadline. |
   
   The suite uses an isolated Pekko actor system and restores `AmberRuntime`'s shared actor-system reference after the suite, so other Amber suites retain their runtime setup.
   
   The assertions were mutation-tested against temporary production changes, all reverted before commit:
   
   | Temporary mutation | Result |
   | --- | --- |
   | `userCount == 0` to `userCount < 0` | 1 test failed |
   | `status == RUNNING` to `status != RUNNING` | 2 tests failed |
   | Remove cancellation of an active cleanup deadline | 1 test failed |
   
   ### Any related issues, documentation, discussions?
   
   Closes #7150
   
   ### How was this PR tested?
   
   ```
   "C:/Program Files (x86)/sbt/bin/sbt" -java-home "C:/Users/linxi/.jdks/jbr-17.0.14" "WorkflowExecutionService/testOnly org.apache.texera.web.WorkflowLifecycleManagerSpec"
   ```
   
   ```
   Tests: succeeded 3, failed 0
   ```
   
   ```
   "C:/Program Files (x86)/sbt/bin/sbt" -java-home "C:/Users/linxi/.jdks/jbr-17.0.14" "WorkflowExecutionService/Test/scalafmtCheck" "WorkflowExecutionService/Test/scalafix --check"
   ```
   
   Both checks completed successfully.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Codex (GPT-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(amber): cover workflow lifecycle cleanup [texera]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #7151:
URL: https://github.com/apache/texera/pull/7151#issuecomment-5138722193

   ## [Codecov](https://app.codecov.io/gh/apache/texera/pull/7151?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 79.61%. Comparing base ([`91ed98d`](https://app.codecov.io/gh/apache/texera/commit/91ed98d78e4eaf7f13755fd8233666ae6089c6e5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`4f24bb6`](https://app.codecov.io/gh/apache/texera/commit/4f24bb6cb8e79fd4edd960ac458b9a4ec086055f?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    #7151      +/-   ##
   ============================================
   + Coverage     79.58%   79.61%   +0.02%     
   - Complexity     3837     3845       +8     
   ============================================
     Files          1160     1160              
     Lines         46188    46188              
     Branches       5145     5145              
   ============================================
   + Hits          36761    36772      +11     
   + Misses         7795     7770      -25     
   - Partials       1632     1646      +14     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/texera/pull/7151/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/7151/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.00% <ø> (ø)` | | Carriedforward from [91ed98d](https://app.codecov.io/gh/apache/texera/commit/91ed98d78e4eaf7f13755fd8233666ae6089c6e5?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/7151/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.42% <ø> (ø)` | | Carriedforward from [91ed98d](https://app.codecov.io/gh/apache/texera/commit/91ed98d78e4eaf7f13755fd8233666ae6089c6e5?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/7151/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.16% <ø> (+0.06%)` | :arrow_up: | |
   | [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/7151/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `20.49% <ø> (ø)` | | Carriedforward from [91ed98d](https://app.codecov.io/gh/apache/texera/commit/91ed98d78e4eaf7f13755fd8233666ae6089c6e5?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/7151/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `65.97% <ø> (ø)` | | Carriedforward from [91ed98d](https://app.codecov.io/gh/apache/texera/commit/91ed98d78e4eaf7f13755fd8233666ae6089c6e5?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/7151/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `66.80% <ø> (ø)` | | Carriedforward from [91ed98d](https://app.codecov.io/gh/apache/texera/commit/91ed98d78e4eaf7f13755fd8233666ae6089c6e5?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/7151/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.08% <ø> (ø)` | | Carriedforward from [91ed98d](https://app.codecov.io/gh/apache/texera/commit/91ed98d78e4eaf7f13755fd8233666ae6089c6e5?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/7151/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `78.89% <ø> (ø)` | | Carriedforward from [91ed98d](https://app.codecov.io/gh/apache/texera/commit/91ed98d78e4eaf7f13755fd8233666ae6089c6e5?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/7151/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `97.31% <ø> (ø)` | | Carriedforward from [91ed98d](https://app.codecov.io/gh/apache/texera/commit/91ed98d78e4eaf7f13755fd8233666ae6089c6e5?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [workflow-compiling-service](https://app.codecov.io/gh/apache/texera/pull/7151/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.31% <ø> (ø)` | | Carriedforward from [91ed98d](https://app.codecov.io/gh/apache/texera/commit/91ed98d78e4eaf7f13755fd8233666ae6089c6e5?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/7151?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(amber): cover workflow lifecycle cleanup [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7151:
URL: https://github.com/apache/texera/pull/7151#issuecomment-5138655249

   <!-- texera-reviewer-suggestion -->
   ### Automated Reviewer Suggestions
   
   Based on the `git blame` history of the changed files, we recommend the following reviewers:
   
   - No candidates found from `git blame` history.
   


-- 
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(amber): cover workflow lifecycle cleanup [texera]

Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan merged PR #7151:
URL: https://github.com/apache/texera/pull/7151


-- 
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(amber): cover workflow lifecycle cleanup [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7151:
URL: https://github.com/apache/texera/pull/7151#issuecomment-5138690809

   <!-- texera-benchmarks-comment -->
   ## ⚠️ Benchmark changes need a look
   
   🟢 0 better · 🔴 1 worse · ⚪ 14 noise (<±5%) · 0 without baseline
   
   > Compared against main `91ed98d` 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/30599803552)
   
   | | config | throughput | MB/s | latency | max Δ latest / 7d |
   |---|---|---:|---:|---:|---:|
   | 🔴 | bs=10 sw=10 sl=64 | 401 | 0.245 | 24,448/34,133/34,133 us | 🔴 +9.3% / 🔴 +116.2% |
   | ⚪ | bs=100 sw=10 sl=64 | 813 | 0.496 | 119,066/155,332/155,332 us | ⚪ within ±5% / 🔴 +40.8% |
   | ⚪ | bs=1000 sw=10 sl=64 | 920 | 0.561 | 1,085,600/1,124,657/1,124,657 us | ⚪ within ±5% / 🔴 -8.2% |
   
   <details><summary>Baseline details</summary>
   
   Latest main `91ed98d` from same runner
   
   | config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
   |---|---|---:|---:|---:|---:|---:|
   | bs=10 sw=10 sl=64 | throughput | 401 tuples/sec | 404 tuples/sec | 771.62 tuples/sec | -0.7% | -48.0% |
   | bs=10 sw=10 sl=64 | MB/s | 0.245 MB/s | 0.247 MB/s | 0.471 MB/s | -0.8% | -48.0% |
   | bs=10 sw=10 sl=64 | p50 | 24,448 us | 22,366 us | 12,626 us | +9.3% | +93.6% |
   | bs=10 sw=10 sl=64 | p95 | 34,133 us | 35,697 us | 15,786 us | -4.4% | +116.2% |
   | bs=10 sw=10 sl=64 | p99 | 34,133 us | 35,697 us | 19,344 us | -4.4% | +76.5% |
   | bs=100 sw=10 sl=64 | throughput | 813 tuples/sec | 807 tuples/sec | 971.56 tuples/sec | +0.7% | -16.3% |
   | bs=100 sw=10 sl=64 | MB/s | 0.496 MB/s | 0.492 MB/s | 0.593 MB/s | +0.8% | -16.4% |
   | bs=100 sw=10 sl=64 | p50 | 119,066 us | 124,036 us | 103,463 us | -4.0% | +15.1% |
   | bs=100 sw=10 sl=64 | p95 | 155,332 us | 148,682 us | 110,296 us | +4.5% | +40.8% |
   | bs=100 sw=10 sl=64 | p99 | 155,332 us | 148,682 us | 118,690 us | +4.5% | +30.9% |
   | bs=1000 sw=10 sl=64 | throughput | 920 tuples/sec | 929 tuples/sec | 1,001 tuples/sec | -1.0% | -8.1% |
   | bs=1000 sw=10 sl=64 | MB/s | 0.561 MB/s | 0.567 MB/s | 0.611 MB/s | -1.1% | -8.2% |
   | bs=1000 sw=10 sl=64 | p50 | 1,085,600 us | 1,075,537 us | 1,008,988 us | +0.9% | +7.6% |
   | bs=1000 sw=10 sl=64 | p95 | 1,124,657 us | 1,102,313 us | 1,055,260 us | +2.0% | +6.6% |
   | bs=1000 sw=10 sl=64 | p99 | 1,124,657 us | 1,102,313 us | 1,074,689 us | +2.0% | +4.6% |
   
   </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,499.00,200,128000,401,0.245,24447.51,34133.29,34133.29
   1,100,10,64,20,2460.90,2000,1280000,813,0.496,119065.95,155332.07,155332.07
   2,1000,10,64,20,21744.01,20000,12800000,920,0.561,1085600.45,1124657.19,1124657.19
   ```
   
   </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(amber): cover workflow lifecycle cleanup [texera]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #7151:
URL: https://github.com/apache/texera/pull/7151#discussion_r3689573010


##########
amber/src/test/scala/org/apache/texera/web/WorkflowLifecycleManagerSpec.scala:
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.texera.web
+
+import org.apache.pekko.actor.ActorSystem
+import org.apache.pekko.testkit.TestKit
+import org.apache.texera.amber.engine.architecture.rpc.controlreturns.WorkflowAggregatedState.{
+  COMPLETED,
+  RUNNING
+}
+import org.apache.texera.amber.engine.common.AmberRuntime
+import org.apache.texera.web.storage.ExecutionStateStore
+import org.scalatest.BeforeAndAfterAll
+import org.scalatest.flatspec.AnyFlatSpec
+
+import java.util.concurrent.{CountDownLatch, TimeUnit}
+
+class WorkflowLifecycleManagerSpec extends AnyFlatSpec with BeforeAndAfterAll {
+
+  // WorkflowLifecycleManager schedules through AmberRuntime's process-wide actor system.
+  // Preserve that shared reference because amber suites run concurrently in one JVM.
+  private lazy val testSystem: ActorSystem =
+    ActorSystem("WorkflowLifecycleManagerSpec-test", AmberRuntime.pekkoConfig)
+
+  private var previousActorSystem: AnyRef = _
+
+  private def getAmberRuntimeField(name: String): AnyRef = {
+    val field = AmberRuntime.getClass.getDeclaredField(name)
+    field.setAccessible(true)
+    field.get(AmberRuntime)
+  }
+
+  private def setAmberRuntimeField(name: String, value: AnyRef): Unit = {
+    val field = AmberRuntime.getClass.getDeclaredField(name)
+    field.setAccessible(true)
+    field.set(AmberRuntime, value)
+  }
+
+  override protected def beforeAll(): Unit = {
+    super.beforeAll()
+    previousActorSystem = getAmberRuntimeField("_actorSystem")
+    setAmberRuntimeField("_actorSystem", testSystem)
+  }
+
+  override protected def afterAll(): Unit = {
+    setAmberRuntimeField("_actorSystem", previousActorSystem)
+    TestKit.shutdownActorSystem(testSystem)
+    super.afterAll()
+  }

Review Comment:
   This suite swaps `AmberRuntime._actorSystem` but does not snapshot/restore `AmberRuntime._serde`. If `_serde` is null (or gets nulled by a concurrently running suite), any call to `AmberRuntime.serde` during this spec can initialize `_serde` against `testSystem`; after `afterAll` shuts `testSystem` down, subsequent tests may see a `SerializationExtension` backed by a terminated ActorSystem, causing flaky failures. Preserve and restore `_serde` alongside `_actorSystem` (pattern used in `HDFSRecordStorageSpec`).



-- 
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