Skip to content

Add unit tests for org.apache.texera.web state stores and websocket plumbing #5208

Closed

Description

@Yicong-Huang

Task Summary

amber/src/main/scala/org/apache/texera/web/ has 124 production Scala files and only 11 specs, so the bulk of the websocket / state-store / auth helpers ship with no direct unit coverage. Cover a self-contained cluster of pure-logic files in one PR:

  • storage/StateStore.scala — observable state with diff-handler registry and ReentrantLock; emits websocket events only on actual state changes
  • storage/WorkflowStateStore.scala and storage/ExecutionStateStore.scala — thin wrappers that enumerate child stores via getAllStores
  • SubscriptionManager.scala — trait that owns a list of Disposables and disposes them in bulk
  • WebsocketInput.scala — type-discriminated rx pub/sub that routes callback exceptions through a user-supplied error handler
  • auth/UserRoleAuthorizer.scala — single-method authorizer that delegates to SessionUser.isRoleOf

Out of scope for this issue (heavier mocking, separate follow-ups):

  • WorkflowLifecycleManager — needs AmberRuntime actor-system scheduling
  • SessionState — needs a javax.websocket.Session double
  • ExecutionStateStore.updateWorkflowState — touches ExecutionsMetadataPersistService and the DB

Task Type

  • Testing / QA

Activity

  1. added a commit that references this issue on May 26, 2026
    1cdfc45
  2. added a commit that references this issue on Jun 22, 2026
    6c71bde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions