aglinxinyuan commented on code in PR #7556:
URL: https://github.com/apache/texera/pull/7556#discussion_r3763514819


##########
amber/src/test/scala/org/apache/texera/web/service/ExecutionResultServiceSpec.scala:
##########
@@ -79,12 +115,20 @@ class ExecutionResultServiceSpec
   private val testUid: Integer = 9001
   private var executionsDao: WorkflowExecutionsDao = _
   private var testVid: Integer = _
+  private var testCuid: Integer = _
+
+  // AmberClient needs an ActorSystem to host its ClientActor. A bare one is 
enough:
+  // the client is constructed over an empty PhysicalPlan, so its 
InitializeRequest
+  // completes without an engine, and the subclass below never sends anything 
to it.
+  private var system: ActorSystem = _

Review Comment:
   Fixed in c0edd92b53 — both halves were right.
   
   `terminate()` is now awaited (`Await.ready(system.terminate(), 30.seconds)`) 
before `shutdownDB()`, so the suite can't move on while dispatcher threads are 
still running, and the system name is suffixed with a UUID so two systems can 
never contend for the same name.
   
   Worth noting the collision half is belt-and-braces here rather than a live 
bug: `build.sbt:175` sets `Test / parallelExecution := false`, so amber's 
suites do not run concurrently in one JVM. The await is the part that actually 
mattered.
   
   While in the same area I also applied two of the suppressed comments:
   
   - **`ResultEvents`** now holds its `Disposable` and every subscription is 
disposed in `afterEach`. You were right that an observer left subscribed keeps 
collecting into its buffer after its test ends, and retains the buffer with it.
   - **`RecordingCancellable`** now follows `Cancellable`'s contract and 
returns whether *that* call did the cancelling, instead of unconditionally 
`true`. The counter still records every call, since that is what the "not 
re-cancel polling that is already cancelled" test observes — so I kept the 
counting and fixed only the return value, and added a scaladoc line saying 
which of the two it counts.



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