1414 * limitations under the License.
1515 */
1616import { Duration , TemporalUnit } from 'node-duration' ;
17- import { GenericContainer , Wait , StartedTestContainer } from 'testcontainers' ;
17+ import { GenericContainer , StartedTestContainer } from 'testcontainers' ;
1818import { Pool } from 'pg' ;
1919
2020import logger from '../logger' ;
@@ -40,18 +40,8 @@ export default async () => {
4040 . withEnv ( 'POSTGRES_USER' , 'postgres' )
4141 . withEnv ( 'POSTGRES_PASSWORD' , 'postgres' )
4242 . withEnv ( 'POSTGRES_DB' , 'postgres' )
43- . withWaitStrategy (
44- Wait . forLogMessage ( 'listening on IPv4 address "0.0.0.0", port 5432' ) ,
45- )
4643 . start ( ) ;
4744
48- // The postgres docker container prints that it's ready for connections twice, so we
49- // have to listen for another log line. However, this log message comes before the
50- // container is actually ready, so we need to wait a little.
51- await new Promise ( resolve => {
52- setTimeout ( resolve , 3000 ) ;
53- } ) ;
54-
5545 // We have to use global setup because it's the only way in Jest to run code once before suite.
5646 // Unfortuantely Jest prevents us from writing globals that are read by the sutite.
5747 // So, we are forced to write the connection info to the ENV.
0 commit comments