getodk / getodk/web-forms

Services do not shut down cleanly after running tests locally

Open
#551 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
38
Forks
22
PR merge metrics
No merged PRs in 30d

Description

Running e.g. `yarn workspace @getodk/web-forms test:e2e` multiple times may sometimes fail:

```sh
$ yarn workspace @getodk/web-forms test:e2e
yarn workspace v1.22.22
yarn run v1.22.22
$ playwright test
Error: http://localhost:5174 is already used, make sure that nothing is running on the port/url or set reuseExistingServer:true in config.webServer.

To open last HTML report run:

yarn playwright show-report

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: ~/.volta/tools/image/node/22.12.0/bin/node
Arguments: ~/.volta/tools/image/yarn/1.22.22/lib/cli.js test:e2e
Directory: ~/workspaces/odk/webforms/packages/web-forms
Output:

info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
```

---

### Expected Behaviour

Should be able to re-run a test command and get the same result as the previous run.

### Observed Behaviour

First invocation runs tests, second and subsequent fail due to already-running service on port 5174.

### Reproduction Steps

I'm not sure what circumstances prevent the webserver from shutting down cleanly.

### Screenshots or Videos

TODO: add `ps` output next time this happens.

### Environment

- Browser version: n/a
- OS: ubuntu
- Web Forms version: `97635abb0a2727ab9550bd58dce93c70668feb1e`

### Additional Context

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running `yarn workspace @getodk/web-forms test:e2e` twice and inspect the Playwright webServer configuration involved in the `localhost:5174` error. Trace why the service remains after the first run, then verify that repeated test commands shut it down cleanly and produce the expected result.

Written by the indexing model from the issue text.

Assessment

Tech stack
playwright, typescript
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.