Skip to content

Commit

Permalink
PMM-10147 PMM-4112 Use one runner for jobs and actions (#938)
Browse files Browse the repository at this point in the history
* PMM-10147 Use one runner for jobs and actions

* PMM-10147 Fix tests

* PMM-10147 Fix tests

* PMM-10147 Fix tests

* PMM-10147 Fix test

* PMM-10147 Disable ireturn linter

* PMM-10147 Refactoring

* PMM-10147 Add missing done flag to actions result

* PMM-10147 Fix tests

* PMM-10147 Fix licence headers

* PMM-10147 Limit max amount of running jobs and actions

* PMM-10147 Cleanup

* PMM-10147 Fix comment

* PMM-10147 Fix error message

* PMM-10147 Send jobs/actions results in case if samaphore wasn't acquired

* PMM-10147 Fix comment

* PMM-19147 Update codeowners
  • Loading branch information
artemgavrilov authored Jul 29, 2022
1 parent 8bd8d60 commit 192c07b
Show file tree
Hide file tree
Showing 56 changed files with 974 additions and 810 deletions.
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
/build/ @nikita-b @atymchuk
/admin/ @michal-kralik
/agent/agents/postgres/ @JiriCtvrtka
/agent/actions/ @artemgavrilov
/agent/jobs/ @artemgavrilov
/agent/runner/ @artemgavrilov
/api/ @BupycHuk
/docs/api/ @atymchuk
/managed/services/checks/ @idoqo
Expand Down
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ linters:
- gochecknoinits # we use init functions
- gomnd # we are using numbers in many cases
- gomoddirectives # we use replace directives
- gomodguard # we are not using modules
- ifshort # a lot of false positives
- interfacer # deprecated
- maligned # deprecated
Expand Down
139 changes: 0 additions & 139 deletions agent/actions/concurrent_runner.go

This file was deleted.

147 changes: 0 additions & 147 deletions agent/actions/concurrent_runner_test.go

This file was deleted.

7 changes: 4 additions & 3 deletions agent/agents/mongodb/internal/profiler/profiler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import (
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"

"github.com/percona/pmm/agent/actions"
"github.com/percona/pmm/agent/agents/mongodb/internal/profiler/aggregator"
"github.com/percona/pmm/agent/agents/mongodb/internal/report"
"github.com/percona/pmm/agent/runner/actions"
"github.com/percona/pmm/agent/utils/templates"
"github.com/percona/pmm/agent/utils/tests"
"github.com/percona/pmm/api/agentpb"
Expand Down Expand Up @@ -216,14 +216,15 @@ func testProfiler(t *testing.T, url string) {
// This test is here to ensure the query example the profiler captures is valid to be used in Explain.
t.Run("TestMongoDBExplain", func(t *testing.T) {
id := "abcd1234"
ctx := context.TODO()

params := &agentpb.StartActionRequest_MongoDBExplainParams{
Dsn: tests.GetTestMongoDBDSN(t),
Query: findBucket.Common.Example,
}

ex := actions.NewMongoDBExplainAction(id, params, os.TempDir())
ex := actions.NewMongoDBExplainAction(id, 5*time.Second, params, os.TempDir())
ctx, cancel := context.WithTimeout(context.Background(), ex.Timeout())
defer cancel()
res, err := ex.Run(ctx)
assert.Nil(t, err)

Expand Down
Loading

0 comments on commit 192c07b

Please sign in to comment.