diff --git a/.github/workflows/ci-dgraph-load-tests.yml b/.github/workflows/ci-dgraph-load-tests.yml index 11e6838d425..e94d903cd5d 100644 --- a/.github/workflows/ci-dgraph-load-tests.yml +++ b/.github/workflows/ci-dgraph-load-tests.yml @@ -36,7 +36,7 @@ on: jobs: dgraph-load-tests: if: github.event.pull_request.draft == false - runs-on: ubuntu-20.04-32gb + runs-on: buildjet-32vcpu-ubuntu-2004 steps: - uses: actions/checkout@v3 - name: Get Go Version diff --git a/.github/workflows/ci-dgraph-tests.yml b/.github/workflows/ci-dgraph-tests.yml index 576c1e1d192..1cc7530e93b 100644 --- a/.github/workflows/ci-dgraph-tests.yml +++ b/.github/workflows/ci-dgraph-tests.yml @@ -36,7 +36,7 @@ on: jobs: dgraph-tests: if: github.event.pull_request.draft == false - runs-on: ubuntu-20.04-32gb + runs-on: buildjet-32vcpu-ubuntu-2004 steps: - uses: actions/checkout@v3 - name: Get Go Version diff --git a/.github/workflows/ci-dgraph-upgrade-tests.yml b/.github/workflows/ci-dgraph-upgrade-tests.yml index b1392282c06..a035e8f02e9 100644 --- a/.github/workflows/ci-dgraph-upgrade-tests.yml +++ b/.github/workflows/ci-dgraph-upgrade-tests.yml @@ -4,12 +4,18 @@ on: branches: - main - 'release/**' + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review schedule: - cron: "0 0 * * *" # 1 run per day jobs: dgraph-upgrade-tests: if: github.event.pull_request.draft == false - runs-on: ubuntu-20.04-32gb + runs-on: buildjet-32vcpu-ubuntu-2004 steps: - uses: actions/checkout@v3 with: diff --git a/dgraphtest/local_cluster.go b/dgraphtest/local_cluster.go index e11c1f0b470..3593c54b593 100644 --- a/dgraphtest/local_cluster.go +++ b/dgraphtest/local_cluster.go @@ -319,17 +319,41 @@ func (c *LocalCluster) Cleanup(verbose bool) { func (c *LocalCluster) Start() error { log.Printf("[INFO] starting cluster with prefix [%v]", c.conf.prefix) - for i := 0; i < c.conf.numZeros; i++ { - if err := c.StartZero(i); err != nil { - return err + startAll := func() error { + for i := 0; i < c.conf.numZeros; i++ { + if err := c.StartZero(i); err != nil { + return err + } } + for i := 0; i < c.conf.numAlphas; i++ { + if err := c.StartAlpha(i); err != nil { + return err + } + } + + return c.HealthCheck(false) } - for i := 0; i < c.conf.numAlphas; i++ { - if err := c.StartAlpha(i); err != nil { + + var err error + // sometimes health check doesn't work due to unmapped ports. We dont know why this happens, + // but checking it 4 times before failing the test. + for i := 0; i < 4; i++ { + + if err = startAll(); err == nil { + return nil + } + log.Printf("[WARNING] Saw the error :%v, trying again", err) + if err1 := c.Stop(); err1 != nil { + log.Printf("[WARNING] error while stopping :%v", err) + } + c.Cleanup(false) + if err := c.init(); err != nil { + c.Cleanup(true) return err } } - return c.HealthCheck(false) + + return err } func (c *LocalCluster) StartZero(id int) error {