Skip to content

Commit 0ce6b4a

Browse files
authored
Merge branch 'main' into PMM-7-use-image-from-env-for-encrypted
2 parents c099cc1 + a1a3427 commit 0ce6b4a

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ jobs:
4141
- name: Test
4242
run: |
4343
TEST_MONGODB_IMAGE=${{ matrix.image }} make test-cluster
44+
sleep 10
4445
make test-race
4546
make test-cluster-clean

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
password: ${{ secrets.GITHUB_TOKEN }}
3737

3838
- name: Set up QEMU
39-
uses: docker/setup-qemu-action@v2
39+
uses: docker/setup-qemu-action@v3
4040

4141
- name: Set up Docker Buildx
4242
id: buildx

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ test-race: env ## Run all tests with race flag.
104104
go test -race -v -timeout 30s ./...
105105

106106
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
107-
docker-compose up -d
107+
docker compose up -d --wait
108108

109109
test-cluster-clean: env ## Stops MongoDB test cluster.
110-
docker-compose down --remove-orphans
110+
docker compose down --remove-orphans

exporter/currentop_collector_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
)
3232

3333
func TestCurrentopCollector(t *testing.T) {
34-
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
34+
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
3535
defer cancel()
3636

3737
var wg sync.WaitGroup
@@ -48,7 +48,7 @@ func TestCurrentopCollector(t *testing.T) {
4848
wg.Add(1)
4949
go func() {
5050
defer wg.Done()
51-
for i := 0; i < 3; i++ {
51+
for i := 0; i < 300; i++ {
5252
coll := fmt.Sprintf("testcol_%02d", i)
5353
_, err := database.Collection(coll).InsertOne(ctx, bson.M{"f1": 1, "f2": "2"})
5454
assert.NoError(t, err)

exporter/v1_compatibility.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ func replSetMetrics(m bson.M) []prometheus.Metric {
971971
for _, m := range repl.Members {
972972
if m.StateStr == "PRIMARY" {
973973
primaryOpTime = m.OptimeDate.Time()
974-
gotPrimary = true
974+
gotPrimary = !primaryOpTime.IsZero()
975975

976976
break
977977
}

0 commit comments

Comments
 (0)