Skip to content

Commit 5116677

Browse files
committed
Test failure fix
1 parent d1571d6 commit 5116677

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

packages/backend/tests/runner.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('TestRunner', () => {
9191
})
9292

9393
describe('run and stop', () => {
94-
it('should prevent concurrent runs and handle environment variables', async () => {
94+
it('should stop existing run and restart with environment variables', async () => {
9595
vi.mocked(spawn).mockReturnValue(mockChild)
9696
const payload: RunnerRequestBody = {
9797
uid: 'test-1',
@@ -104,9 +104,8 @@ describe('TestRunner', () => {
104104
const firstRun = testRunner.run(payload)
105105
await new Promise((resolve) => setTimeout(resolve, 10))
106106

107-
await expect(testRunner.run(payload)).rejects.toThrow(
108-
'A test run is already in progress'
109-
)
107+
// A concurrent run stops the existing process and starts a new one
108+
await expect(testRunner.run(payload)).resolves.toBeUndefined()
110109

111110
const env = vi.mocked(spawn).mock.calls[0][2]?.env as Record<
112111
string,

0 commit comments

Comments
 (0)