pilichoumao opened a new issue, #6616:
URL: https://github.com/apache/rocketmq-dashboard/issues/6616

   ### Before Creating the Bug Report
   - [x] Searched existing issues and pull requests; no matching test-stability 
fix found.
   - [x] This concerns RocketMQ Studio frontend tests in this repository.
   - [x] Exact failing revision and baseline are stated below.
   
   ### Studio Version
   `rocketmq-studio` baseline: `779b8c0e7aed2396d3cc72743dcd544ea48e9ae6`.
   Observed in #6611 at `1f658c695768712860941b319fd6e5dbdabc9815`; both 
CloudCredentialTab source and test are unchanged from that baseline.
   
   ### Runtime Environment
   GitHub Actions frontend job, Vitest with jsdom. Independent baseline 
verification on Ubuntu 24.04 ECS passed all 21 cases in isolation, so the 
timing failure is intermittent.
   
   ### Connected RocketMQ Cluster
   Not required: the test suite mocks the cloud-credential API.
   
   ### Build Toolchain
   Node.js 20 (CI); independent ECS verification uses Node.js 20.20.2.
   
   ### Describe the Bug
   Two error-state tests synchronously assert that Ant Design's spinner has 
disappeared immediately after finding the error alert. The alert can become 
visible before the spinner finishes updating. In the initial-load case, a 
failure before clicking Retry also leaves an unused `mockResolvedValueOnce` 
response. `vi.clearAllMocks()` clears call history but retains that queue, so 
the next creation test can receive an empty inventory instead of its default 
fixture.
   
   ### Steps to Reproduce
   Run the full frontend suite (`cd web && npm test`). The intermittent spinner 
failure occurred in [this frontend CI 
job](https://github.com/apache/rocketmq-dashboard/actions/runs/38375952139/job/115224234481).
 Running the file alone does not reliably reproduce the timing failure.
   
   ### What Did You Expect to See?
   Assertions wait for the spinner to disappear, and each test starts with its 
own default list response even if a previous test did not consume a one-time 
response.
   
   ### What Did You See Instead?
   `reports an initial credential load failure instead of an empty inventory` 
failed because `.ant-spin-spinning` was still present. The following `creates a 
credential from the modal form` failed while waiting for `aliyun-test`. The 
frontend job reported 1614 passing and 2 failing tests.
   
   ### Additional Context
   This is a test-only stability fix: preserve all error/retry assertions, wait 
for the spinner state, and reset the list API mock before reinstalling its 
default response. Resetting every mock would also reset the matchMedia shim 
installed in beforeAll, so a targeted reset is appropriate.
   
   ### Are You Willing to Submit a Pull Request?
   - [x] Yes.
   


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