Problem:
When running a command like psql, the step can hang and lead to it timing out. This is due to it expecting the user to interact with it whereas CircleCI jobs are run in a non-interactive environment.
Solutions:
-
Disable psql pager with
-P 'pager=off'
option- Example:
psql -q -d postgres -h localhost -p ${TEST_DB_PORT:-'5433'} -P 'pager=off' -U test -w -c "DROP DATABASE IF EXISTS test;";
- Example:
Outcome:
The step will no longer hang, and will finish executing, preventing a long running job.
Comments
Article is closed for comments.