Skip to content

Commit

Permalink
Chore: don't sleep during acceptance tests (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerHeber committed Apr 11, 2022
1 parent d58ecd8 commit 647633b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion env0/resource_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"log"
"os"
"regexp"
"time"

Expand Down Expand Up @@ -730,7 +731,10 @@ func waitForDeployment(deploymentLogId string, apiClient client.ApiClientInterfa
"QUEUED",
"WAITING_FOR_USER":
log.Println("[INFO] Deployment not yet done deploying. Got status ", deployment.Status)
time.Sleep(deploymentStatusWaitPollInterval * time.Second)
// TF_ACC is set during acceptance tests. Don't pause during accpetance tests.
if value, present := os.LookupEnv("TF_ACC"); !present || value != "1" {
time.Sleep(deploymentStatusWaitPollInterval * time.Second)
}
case "SUCCESS",
"SKIPPED":
log.Println("[INFO] Deployment done deploying! Got status ", deployment.Status)
Expand Down

0 comments on commit 647633b

Please sign in to comment.