-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Server Programmability
-
Programmability 2025-10-13, Programmability 2025-10-27, Programmability 2025-11-24
-
None
-
None
-
None
-
None
-
None
-
None
-
None
A scoped task executor acknowledging that its final remaining task has completed and its underlying executor acknowledging that that task has finished are not mutually synchronized. This means that calling scopedTaskExecutor.join() does not guarantee executor.hasTasks() returning false even if no tasks are scheduled on the executor independently of the scoped executor.
As a result, I don't see any good way for a component that uses scoped executors to ensure that it cleans up its work. The natural way to do that would be to make a ThreadPoolTaskExecutor in the test fixture, give that to the component, and then call hasTasks on the executor after the component goes out of scope.
Improve support for asserting tasks get cleaned up in testing.
Beyond the specific case discussed here, I think this demonstrates a larger problem with the task execution story where it's difficult to track down in-progress tasks and assert properties about the task execution model about a component that's being tested.