Skip to content

Commit

Permalink
Merge branch 'main' into v3
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Aug 2, 2024
2 parents fb8105a + a06f8fd commit 31ff49f
Show file tree
Hide file tree
Showing 51 changed files with 639 additions and 596 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
* @percona/pmm-review-be
/docs/ @percona/pmm-docs
/ui/ @percona/pmm-review-fe
/agent/agents/postgres/ @JiriCtvrtka @percona/pmm-review-be
/api/ @BupycHuk @percona/pmm-review-be
/managed/services/checks/ @idoqo @percona/pmm-review-be
Expand Down
40 changes: 20 additions & 20 deletions agent/runner/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,36 +156,36 @@ func TestPerDBInstanceLimit(t *testing.T) {
db2j2 := testJob{id: "test-5", timeout: time.Second, dsn: "postgresql://db2"}
db2j3 := testJob{id: "test-6", timeout: time.Second, dsn: "postgresql://db2"}

require.NoError(t, cr.StartJob(db1j1))
require.NoError(t, cr.StartJob(db2j1))
require.NoError(t, cr.StartJob(db1j1), "start job db1j1 failed")
require.NoError(t, cr.StartJob(db2j1), "start job db2j1 failed")

// Let jobs to start
time.Sleep(200 * time.Millisecond)

require.NoError(t, cr.StartJob(db1j2))
require.NoError(t, cr.StartJob(db2j2))
require.NoError(t, cr.StartJob(db1j3))
require.NoError(t, cr.StartJob(db2j3))
require.NoError(t, cr.StartJob(db1j2), "start job db1j2 failed")
require.NoError(t, cr.StartJob(db2j2), "start job db2j2 failed")
require.NoError(t, cr.StartJob(db1j3), "start job db1j3 failed")
require.NoError(t, cr.StartJob(db2j3), "start job db2j3 failed")

// Let rest jobs to reach semaphores
time.Sleep(300 * time.Millisecond)

assert.True(t, cr.IsRunning(db1j1.ID()))
assert.True(t, cr.IsRunning(db2j1.ID()))
assert.False(t, cr.IsRunning(db1j2.ID()))
assert.False(t, cr.IsRunning(db2j2.ID()))
assert.False(t, cr.IsRunning(db1j3.ID()))
assert.False(t, cr.IsRunning(db2j3.ID()))
assert.True(t, cr.IsRunning(db1j1.ID()), "db1j1 is not running")
assert.True(t, cr.IsRunning(db2j1.ID()), "db2j1 is not running")
assert.False(t, cr.IsRunning(db1j2.ID()), "db1j2 is running")
assert.False(t, cr.IsRunning(db2j2.ID()), "db2j2 is running")
assert.False(t, cr.IsRunning(db1j3.ID()), "db1j3 is running")
assert.False(t, cr.IsRunning(db2j3.ID()), "db2j3 is running")

// Over time all jobs are terminated
time.Sleep(2 * time.Second)

assert.False(t, cr.IsRunning(db1j1.ID()))
assert.False(t, cr.IsRunning(db2j1.ID()))
assert.False(t, cr.IsRunning(db1j2.ID()))
assert.False(t, cr.IsRunning(db2j2.ID()))
assert.False(t, cr.IsRunning(db1j3.ID()))
assert.False(t, cr.IsRunning(db2j3.ID()))
time.Sleep(3 * time.Second)

assert.False(t, cr.IsRunning(db1j1.ID()), "db1j1 is running")
assert.False(t, cr.IsRunning(db2j1.ID()), "db2j1 is running")
assert.False(t, cr.IsRunning(db1j2.ID()), "db1j2 is running")
assert.False(t, cr.IsRunning(db2j2.ID()), "db2j2 is running")
assert.False(t, cr.IsRunning(db1j3.ID()), "db1j3 is running")
assert.False(t, cr.IsRunning(db2j3.ID()), "db2j3 is running")
}

func TestDefaultPerDBInstanceLimit(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions api/accesscontrol/v1beta1/accesscontrol.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 21 additions & 10 deletions api/accesscontrol/v1beta1/accesscontrol_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions api/actions/v1/actions.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 15 additions & 7 deletions api/actions/v1/actions_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions api/advisors/v1/advisors.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 31ff49f

Please sign in to comment.