humanmade / plugin-tester

Simple Docker image for running unit tests for WordPress plugins
21 stars 2 forks source link

Wait up to 5s for mysql, checking every second #11

Closed kadamwhite closed 4 years ago

kadamwhite commented 4 years ago

If MySQL takes >1s to start, which happens with some regularity in CI, the tests will not execute and a database connection error will be displayed in the test logs.

Instead of "sleep 1," retry every second for 5s or until mysql starts.

This logic could probably improved, but this consistently allows the tests to run once mysql is available on my local, where before it would only succeed ~60% of the time.

See #10

kadamwhite commented 4 years ago

hooray! Thanks @joehoyle :laughing: