@@ -84,7 +84,7 @@ func TestAppsV2Example(t *testing.T) {
8484ENV BUILT_BY_DOCKERFILE=true
8585`
8686 dockerfilePath := filepath .Join (f .WorkDir (), "Dockerfile" )
87- err := os .WriteFile (dockerfilePath , []byte (dockerfileContent ), 0644 )
87+ err := os .WriteFile (dockerfilePath , []byte (dockerfileContent ), 0o644 )
8888 if err != nil {
8989 f .Fatalf ("failed to write dockerfile at %s error: %v" , dockerfilePath , err )
9090 }
@@ -109,7 +109,7 @@ func TestAppsV2ConfigChanges(t *testing.T) {
109109 newConfigFile := strings .Replace (string (configFileBytes ), `FOO = 'BAR'` , `BAR = "QUX"` , 1 )
110110 require .Contains (f , newConfigFile , `BAR = "QUX"` )
111111
112- err = os .WriteFile (configFilePath , []byte (newConfigFile ), 0666 )
112+ err = os .WriteFile (configFilePath , []byte (newConfigFile ), 0o666 )
113113 require .NoError (t , err )
114114
115115 f .Fly ("deploy --buildkit --remote-only --detach" )
@@ -177,7 +177,7 @@ func TestAppsV2Config_ParseExperimental(t *testing.T) {
177177 auto_rollback = true
178178 `
179179
180- err := os .WriteFile (configFilePath , []byte (config ), 0644 )
180+ err := os .WriteFile (configFilePath , []byte (config ), 0o644 )
181181 require .NoError (t , err , "error trying to write %s" , configFilePath )
182182
183183 result := f .Fly ("launch --no-deploy --ha=false --name %s --region ord --copy-config --org %s" , appName , f .OrgSlug ())
@@ -208,7 +208,7 @@ func TestAppsV2Config_ProcessGroups(t *testing.T) {
208208
209209 deployToml := func (toml string ) * testlib.FlyctlResult {
210210 toml = "app = \" " + appName + "\" \n " + toml
211- err := os .WriteFile (configFilePath , []byte (toml ), 0666 )
211+ err := os .WriteFile (configFilePath , []byte (toml ), 0o666 )
212212 require .NoError (t , err , "error trying to write %s" , configFilePath )
213213 cmd := f .Fly ("deploy --buildkit --remote-only --detach --now --image nginx --ha=false" )
214214 cmd .AssertSuccessfulExit ()
@@ -252,10 +252,8 @@ func TestAppsV2Config_ProcessGroups(t *testing.T) {
252252
253253 deployOut := deployToml (`
254254[[services]]
255- http_checks = []
256255 internal_port = 8080
257256 protocol = "tcp"
258- script_checks = []
259257
260258 [[services.ports]]
261259 port = 80
@@ -279,10 +277,8 @@ bar_web = "bash -c 'while true; do sleep 10; done'"
279277
280278[[services]]
281279 processes = ["web"] # this service only applies to the web process
282- http_checks = []
283280 internal_port = 8080
284281 protocol = "tcp"
285- script_checks = []
286282
287283 [[services.ports]]
288284 port = 80
@@ -320,6 +316,7 @@ bar_web = "bash -c 'while true; do sleep 10; done'"
320316 if len (f .OtherRegions ()) > 0 {
321317 secondaryRegion = f .OtherRegions ()[0 ]
322318 }
319+
323320 f .Fly ("m clone %s --region %s" , barWebMachId , secondaryRegion )
324321 f .Fly ("machine update %s -m ABCD=EFGH -y" , webMachId ).AssertSuccessfulExit ()
325322
@@ -349,6 +346,13 @@ web = "nginx -g 'daemon off;'"
349346
350347 // Step 5: Set secrets, to ensure that machine data is kept during a 'restartOnly' deploy.
351348 f .Fly ("machine update %s -m CUSTOM=META -y" , webMachId ).AssertSuccessfulExit ()
349+ // XXX: this sucks but until update waits for the machine to reach a terminal state
350+ // before returning, we have to wait an arbitrary amount of time here to ensure
351+ // that the machine is ready for another update.
352+ // TODO: Replace with an eventually loop
353+ time .Sleep (10 * time .Second )
354+
355+ f .Logf ("machines before update: %s" , f .Fly ("m status -d -a %s %s" , appName , webMachId ).StdOutString ())
352356 f .Fly ("secrets set 'SOME=MY_SECRET_TEST_STRING' -a %s" , appName ).AssertSuccessfulExit ()
353357
354358 machines = f .MachinesList (appName )
@@ -512,7 +516,7 @@ func TestImageLabel(t *testing.T) {
512516ENV BUILT_BY_DOCKERFILE=true
513517`
514518 dockerfilePath := filepath .Join (f .WorkDir (), "Dockerfile" )
515- err := os .WriteFile (dockerfilePath , []byte (dockerfileContent ), 0644 )
519+ err := os .WriteFile (dockerfilePath , []byte (dockerfileContent ), 0o644 )
516520 if err != nil {
517521 f .Fatalf ("failed to write dockerfile at %s error: %v" , dockerfilePath , err )
518522 }
0 commit comments