aglinxinyuan opened a new issue, #7755:
URL: https://github.com/apache/texera/issues/7755

   ### Describe the bug
   
   `agent-panel.component.spec.ts`'s tab-selection test fails intermittently in 
CI:
   
   ```
   FAIL  gui  
src/app/workspace/component/agent/agent-panel/agent-panel.component.spec.ts
     > AgentPanelComponent > rendered template
     > clicking an agent's tab header activates that agent and marks only its 
chat active
   AssertionError: expected "vi.fn()" to be called with arguments: [ 'b' ]
   Number of calls: 0
   ```
   
   It has failed on both `ubuntu-latest` and `windows-latest` runners while 
passing locally, including a clean local run of the full 201-file suite. It is 
currently red on unrelated PRs, so it blocks anything touching the frontend.
   
   The cause is a timing dependency rather than a regression: the test clicks 
the tab header and then calls `fixture.detectChanges()` once, but `nz-tabs` 
does not emit `nzSelectedIndexChange` from its click handler — it emits during 
its own change-detection pass. A single `detectChanges()` is therefore not 
guaranteed to have run `onTabSelectChange`, so `activateAgent` may not have 
been called yet.
   
   Note that `fixture.whenStable()` is not a usable remedy: the panel keeps a 
long-lived subscription open, so awaiting stability hangs the test until its 
20s timeout.
   
   ### How to reproduce?
   
   Re-run the frontend unit-test job on any PR touching the frontend; it fails 
intermittently. Locally the whole suite passes, which is why this needs fixing 
at the test rather than by re-running CI.
   
   ### Version/Branch
   
   main
   
   ### 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]

Reply via email to