Skip to content

Commit 95ab46e

Browse files
authored
[examples tests] insert one second sleep for services to initialize (#904)
## Summary The lepp-stack test was sporadically failing with unable to find the working postgres socket. I think but not 100% this could be because the `devbox services start` completes but postgres may take a short while to fully initialize before it is ready. So, here I inject a one second sleep to hopefully let postgres be ready. ## How was it tested? `DEVBOX_EXAMPLE_TESTS=1 DEVBOX_DEBUG=0 go test -v -count 1 -run TestExamples/stacks_l ./testscripts/...`
1 parent e0c3aac commit 95ab46e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

examples/stacks/lapp-stack/devbox.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
"psql devbox_lapp < setup_postgres_db.sql"
1919
],
2020
"run_test": [
21-
"initdb",
21+
"devbox run init_db",
2222
"devbox services start",
23+
"echo 'sleep 1 second for the postgres server to initialize.' && sleep 1",
2324
"devbox run create_db",
2425
"curl localhost:$HTTPD_PORT",
2526
"devbox services stop"

examples/stacks/lepp-stack/devbox.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
"psql devbox_lepp < setup_postgres_db.sql"
1919
],
2020
"run_test": [
21-
"initdb",
21+
"devbox run init_db",
2222
"devbox services start",
23+
"echo 'sleep 1 second for the postgres server to initialize.' && sleep 1",
2324
"devbox run create_db",
2425
"curl localhost:8089",
2526
"devbox services stop"

0 commit comments

Comments
 (0)