WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 4 months ago

#50342 new defect (bug)

Local development environment installation doesn't wait for the mysql container to start

Reported by: johnbillion Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.3
Component: Build/Test Tools Keywords: needs-patch
Focuses: Cc:

Description

Given a user who is installing the local development environment for the first time according to instructions in the project's readme file, the mysql container is not guaranteed to be fully up and running when the npm run env:start script ends, which means the subsequent npm run env:install script will fail when it cannot connect to the mysql host.

This is quite easy to reproduce by copying and pasting those four commands into your terminal so they execute in succession.

Can the npm run env:start script be made to wait until mysql is ready before terminating?

Change History (1)

#1 @desrosj
4 months ago

This can also be demonstrated by chaining commands.

npm run env:start && npm run env:install

According to the Docker compose documentation, the depends_on can be used to control start up order, but Docker does not wait for each service to be "ready".

There is wait-on currently loaded and used in the local-env/scripts. Looks like that could probably be used here as well.

Note: See TracTickets for help on using tickets.