Skip to content

Commit

Permalink
Merge branch 'main' into PMM-7-use-image-from-env-for-encrypted
Browse files Browse the repository at this point in the history
  • Loading branch information
BupycHuk authored Oct 9, 2023
2 parents c099cc1 + a1a3427 commit 0ce6b4a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ jobs:
- name: Test
run: |
TEST_MONGODB_IMAGE=${{ matrix.image }} make test-cluster
sleep 10
make test-race
make test-cluster-clean
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ test-race: env ## Run all tests with race flag.
go test -race -v -timeout 30s ./...

test-cluster: env ## Starts MongoDB test cluster. Use env var TEST_MONGODB_IMAGE to set flavor and version. Example: TEST_MONGODB_IMAGE=mongo:3.6 make test-cluster
docker-compose up -d
docker compose up -d --wait

test-cluster-clean: env ## Stops MongoDB test cluster.
docker-compose down --remove-orphans
docker compose down --remove-orphans
4 changes: 2 additions & 2 deletions exporter/currentop_collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
)

func TestCurrentopCollector(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

var wg sync.WaitGroup
Expand All @@ -48,7 +48,7 @@ func TestCurrentopCollector(t *testing.T) {
wg.Add(1)
go func() {
defer wg.Done()
for i := 0; i < 3; i++ {
for i := 0; i < 300; i++ {
coll := fmt.Sprintf("testcol_%02d", i)
_, err := database.Collection(coll).InsertOne(ctx, bson.M{"f1": 1, "f2": "2"})
assert.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion exporter/v1_compatibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ func replSetMetrics(m bson.M) []prometheus.Metric {
for _, m := range repl.Members {
if m.StateStr == "PRIMARY" {
primaryOpTime = m.OptimeDate.Time()
gotPrimary = true
gotPrimary = !primaryOpTime.IsZero()

break
}
Expand Down

0 comments on commit 0ce6b4a

Please sign in to comment.