Closed akauppi closed 1 year ago
Between Jest having written "Ran all the tests", and it returning the process to npm is where there's a WEIRD 30+ s pause on Windows+WSL2. It does eventually return. Likely some timeout within Jest, but which???
Docker Desktop for Windows 4.0.1 Jest 27.2.0 (also happens with 27.1.1)
Work-around for now: increased warm-up timeout to 2 min in DC.
There still is the strange pause (next.jun22
branch).
$ LOGS_PATH=./logs FUNCTIONS_PORT=5002 docker compose up warm-up --abort-on-container-exit
..seems to start warm-up normally.
$ npm test
# 20s: "backend-warm-up-1 Started"
# 3m17s: tests start
# 3m30s: tests end; success
What goes on within that 3 min?
Once/if solved, reduce
start_period
inpackages/backend/docker-compose.yml
and remove a comment there.
Note: This only affects cold starts (all Docker containers are down).
The strange behaviour still seems to be there, though the above instructions no longer apply for reproduction.
Looks like a Jest exit timeout. (Jest 29.3.0)
Adding --forceExit
to the Jest flags helps. Note that --detectOpenHandles
gives no indication what the problematic resources would be. likely keeping the work-around, because it makes for a better initial developer experience.
The Jest issue is this.
Complex. The current gut feeling is, it has to do with firebase-prime
and could be counteracted by the snippet in that issue here.
Immediate work-around
Adding --forceExit
to the calling of the Jest works, cutting Jest process execution from 1:26s to 15s (measured by time
preceding the Jest command). Tempting to leave it ... but solving it within the tests would be nicer!
Preparation:
npm install
in the root and ´packages/backend`backend/docker-compose.yml
, after the warm-up npm command:Steps:
packages/backend
:Expectation:
Actual:
This means
warmed-up
times out,npm test
doesn't work etc.Docker Desktop for Windows 4.0.1