@@ -167,9 +167,7 @@ func assertMachineCount(tb assert.TestingT, f *testlib.FlyctlTestEnv, appName st
167167
168168// assertPostgresIsUp checks that the given Postgres server is really up.
169169// Even after "fly pg create", sometimes the server is not ready for accepting connections.
170- func assertPostgresIsUp (tb testing.TB , f * testlib.FlyctlTestEnv , appName string ) {
171- tb .Helper ()
172-
170+ func assertPostgresIsUp (tb assert.TestingT , f * testlib.FlyctlTestEnv , appName string ) {
173171 ssh := f .FlyAllowExitFailure (`ssh console -a %s -u postgres -C "psql -p 5433 -h /run/postgresql -c 'SELECT 1'"` , appName )
174172 assert .Equal (tb , 0 , ssh .ExitCode (), "failed to connect to postgres at %s: %s" , appName , ssh .StdErr ())
175173}
@@ -196,7 +194,7 @@ func TestPostgres_ImportSuccess(t *testing.T) {
196194 "pg create --org %s --name %s --region %s --initial-cluster-size 1 --vm-size %s --volume-size 1" ,
197195 f .OrgSlug (), secondAppName , f .PrimaryRegion (), postgresMachineSize ,
198196 )
199- assert .EventuallyWithT (t , func (c * assert.CollectT ) {
197+ assert .EventuallyWithT (t , func (t * assert.CollectT ) {
200198 assertPostgresIsUp (t , f , firstAppName )
201199 }, 1 * time .Minute , 10 * time .Second )
202200
@@ -222,7 +220,7 @@ func TestPostgres_ImportSuccess(t *testing.T) {
222220 require .Contains (f , output , firstAppName )
223221
224222 // Wait for the importer machine to be destroyed.
225- assert .EventuallyWithT (t , func (c * assert.CollectT ) {
223+ assert .EventuallyWithT (t , func (t * assert.CollectT ) {
226224 assertMachineCount (t , f , secondAppName , 1 )
227225 }, 2 * time .Minute , 10 * time .Second , "import machine not destroyed" )
228226}
@@ -244,7 +242,7 @@ func TestPostgres_ImportFailure(t *testing.T) {
244242 "pg create --org %s --name %s --region %s --initial-cluster-size 1 --vm-size %s --volume-size 1 --password x" ,
245243 f .OrgSlug (), appName , f .PrimaryRegion (), postgresMachineSize ,
246244 )
247- assert .EventuallyWithT (t , func (c * assert.CollectT ) {
245+ assert .EventuallyWithT (t , func (t * assert.CollectT ) {
248246 assertPostgresIsUp (t , f , appName )
249247 }, 1 * time .Minute , 10 * time .Second )
250248
@@ -256,7 +254,7 @@ func TestPostgres_ImportFailure(t *testing.T) {
256254 require .Contains (f , result .StdOut ().String (), "database \" test\" does not exist" )
257255
258256 // Wait for the importer machine to be destroyed.
259- assert .EventuallyWithT (t , func (c * assert.CollectT ) {
257+ assert .EventuallyWithT (t , func (t * assert.CollectT ) {
260258 assertMachineCount (t , f , appName , 1 )
261259 }, 1 * time .Minute , 10 * time .Second , "import machine not destroyed" )
262260}
0 commit comments