Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(upgrade):enable upgrade workflow on PR #9046

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-dgraph-load-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-dgraph-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ci-dgraph-upgrade-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
36 changes: 30 additions & 6 deletions dgraphtest/local_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading