mengw15 opened a new issue, #6754: URL: https://github.com/apache/texera/issues/6754
### Task Summary Two related workspace services — the computing-unit status store and the websocket transport it builds on. Their specs leave the state-management and connection logic partly untested. Extend both. jsdom/Vitest; see `frontend/TESTING.md`. ### Behavior to add **ComputingUnitStatusService** (`frontend/src/app/common/service/computing-unit/computing-unit-status/computing-unit-status.service.ts`, codecov ~72% — EXTEND) - Inject a `WorkflowWebsocketService` double (`vi.fn()`/stub — no real socket). Cover: `getAllComputingUnits` / `getSelectedComputingUnit` / `getSelectedComputingUnitValue` / `getStatus` after seeding state; `setComputingUnitsState` / `updateUnitInList` mutate the list and emit; `selectComputingUnit` updates the selection; `getConnectionResetStream` emits on reset. - Polling: `startPollingSelectedUnit` / `stopPollingSelectedUnit` / `startRefreshInterval` use a timer — drive them with `vi.useFakeTimers()` and `fixture`/service teardown so no interval keeps ticking across tests (leaked-timer flaky rule); assert the poll effect on tick, then restore real timers. `disconnect` tears down cleanly. **WorkflowWebsocketService** (`frontend/src/app/workspace/service/workflow-websocket/workflow-websocket.service.ts`, codecov ~68% — EXTEND) - Mock the `rxjs/webSocket` `webSocket` factory (return a controllable `Subject`); do NOT open a real socket. Cover: `openWebsocket` wires the subject and updates connection status; `websocketEvent` sends/receives an event through it; `getConnectionStatusStream` / `updateConnectionStatus` reflect connect/disconnect; `closeWebsocket` completes the subject and unsubscribes. ### Task Type - [ ] Refactor / Cleanup - [ ] DevOps / Deployment / CI - [x] Testing / QA - [ ] Documentation - [ ] Performance - [ ] Other -- 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]
