Skip to content

Commit 86bd49a

Browse files
author
Divjot Arora
committed
Add TOPOLOGY variable to Evergreen config (#257)
1 parent 2446ee6 commit 86bd49a

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

.evergreen/config.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ functions:
202202
cp ${PROJECT_DIRECTORY}/data/certificates/client.pem ${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem
203203
cp ${PROJECT_DIRECTORY}/data/certificates/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem
204204
205-
MONGODB_VERSION=${VERSION} AUTH=${AUTH} SSL=${SSL} sh ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
205+
MONGODB_VERSION=${VERSION} TOPOLOGY=${TOPOLOGY} AUTH=${AUTH} SSL=${SSL} sh ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
206206
- command: expansions.update
207207
params:
208208
file: mo-expansion.yml
@@ -286,6 +286,7 @@ functions:
286286
AUTH=${AUTH} \
287287
SSL=${SSL} \
288288
MONGODB_URI="${MONGODB_URI}" \
289+
TOPOLOGY=${TOPOLOGY} \
289290
MONGO_GO_DRIVER_COMPRESSOR=${MONGO_GO_DRIVER_COMPRESSOR} \
290291
BUILD_TAGS="-tags cse" \
291292
AWS_ACCESS_KEY_ID="${cse_aws_access_key_id}" \
@@ -458,6 +459,7 @@ tasks:
458459
commands:
459460
- func: bootstrap-mongo-orchestration
460461
vars:
462+
TOPOLOGY: "server"
461463
AUTH: "noauth"
462464
SSL: "nossl"
463465
- func: run-make
@@ -477,10 +479,12 @@ tasks:
477479
commands:
478480
- func: bootstrap-mongo-orchestration
479481
vars:
482+
TOPOLOGY: "server"
480483
AUTH: "noauth"
481484
SSL: "nossl"
482485
- func: run-tests
483486
vars:
487+
TOPOLOGY: "server"
484488
AUTH: "noauth"
485489
SSL: "nossl"
486490

@@ -489,10 +493,12 @@ tasks:
489493
commands:
490494
- func: bootstrap-mongo-orchestration
491495
vars:
496+
TOPOLOGY: "server"
492497
AUTH: "noauth"
493498
SSL: "nossl"
494499
- func: run-tests
495500
vars:
501+
TOPOLOGY: "server"
496502
AUTH: "noauth"
497503
SSL: "nossl"
498504
MONGO_GO_DRIVER_COMPRESSOR: "snappy"
@@ -502,10 +508,12 @@ tasks:
502508
commands:
503509
- func: bootstrap-mongo-orchestration
504510
vars:
511+
TOPOLOGY: "server"
505512
AUTH: "noauth"
506513
SSL: "nossl"
507514
- func: run-tests
508515
vars:
516+
TOPOLOGY: "server"
509517
AUTH: "noauth"
510518
SSL: "nossl"
511519
MONGO_GO_DRIVER_COMPRESSOR: "zlib"
@@ -515,10 +523,12 @@ tasks:
515523
commands:
516524
- func: bootstrap-mongo-orchestration
517525
vars:
526+
TOPOLOGY: "server"
518527
AUTH: "noauth"
519528
SSL: "nossl"
520529
- func: run-tests
521530
vars:
531+
TOPOLOGY: "server"
522532
AUTH: "noauth"
523533
SSL: "nossl"
524534
MONGO_GO_DRIVER_COMPRESSOR: "zstd"
@@ -528,10 +538,12 @@ tasks:
528538
commands:
529539
- func: bootstrap-mongo-orchestration
530540
vars:
541+
TOPOLOGY: "server"
531542
AUTH: "auth"
532543
SSL: "ssl"
533544
- func: run-tests
534545
vars:
546+
TOPOLOGY: "server"
535547
AUTH: "auth"
536548
SSL: "ssl"
537549

@@ -540,10 +552,12 @@ tasks:
540552
commands:
541553
- func: bootstrap-mongo-orchestration
542554
vars:
555+
TOPOLOGY: "server"
543556
AUTH: "auth"
544557
SSL: "ssl"
545558
- func: run-tests
546559
vars:
560+
TOPOLOGY: "server"
547561
AUTH: "auth"
548562
SSL: "ssl"
549563
MONGO_GO_DRIVER_COMPRESSOR: "snappy"
@@ -553,10 +567,12 @@ tasks:
553567
commands:
554568
- func: bootstrap-mongo-orchestration
555569
vars:
570+
TOPOLOGY: "server"
556571
AUTH: "auth"
557572
SSL: "ssl"
558573
- func: run-tests
559574
vars:
575+
TOPOLOGY: "server"
560576
AUTH: "auth"
561577
SSL: "ssl"
562578
MONGO_GO_DRIVER_COMPRESSOR: "zlib"
@@ -566,10 +582,12 @@ tasks:
566582
commands:
567583
- func: bootstrap-mongo-orchestration
568584
vars:
585+
TOPOLOGY: "server"
569586
AUTH: "auth"
570587
SSL: "ssl"
571588
- func: run-tests
572589
vars:
590+
TOPOLOGY: "server"
573591
AUTH: "auth"
574592
SSL: "ssl"
575593
MONGO_GO_DRIVER_COMPRESSOR: "zstd"
@@ -579,10 +597,12 @@ tasks:
579597
commands:
580598
- func: bootstrap-mongo-orchestration
581599
vars:
600+
TOPOLOGY: "replica_set"
582601
AUTH: "noauth"
583602
SSL: "nossl"
584603
- func: run-tests
585604
vars:
605+
TOPOLOGY: "replica_set"
586606
AUTH: "noauth"
587607
SSL: "nossl"
588608

@@ -591,10 +611,12 @@ tasks:
591611
commands:
592612
- func: bootstrap-mongo-orchestration
593613
vars:
614+
TOPOLOGY: "replica_set"
594615
AUTH: "auth"
595616
SSL: "ssl"
596617
- func: run-tests
597618
vars:
619+
TOPOLOGY: "replica_set"
598620
AUTH: "auth"
599621
SSL: "ssl"
600622

@@ -603,10 +625,12 @@ tasks:
603625
commands:
604626
- func: bootstrap-mongo-orchestration
605627
vars:
628+
TOPOLOGY: "sharded_cluster"
606629
AUTH: "noauth"
607630
SSL: "nossl"
608631
- func: run-tests
609632
vars:
633+
TOPOLOGY: "sharded_cluster"
610634
AUTH: "noauth"
611635
SSL: "nossl"
612636

@@ -615,10 +639,12 @@ tasks:
615639
commands:
616640
- func: bootstrap-mongo-orchestration
617641
vars:
642+
TOPOLOGY: "sharded_cluster"
618643
AUTH: "noauth"
619644
SSL: "nossl"
620645
- func: run-tests
621646
vars:
647+
TOPOLOGY: "sharded_cluster"
622648
AUTH: "noauth"
623649
SSL: "nossl"
624650
MONGO_GO_DRIVER_COMPRESSOR: "snappy"
@@ -628,10 +654,12 @@ tasks:
628654
commands:
629655
- func: bootstrap-mongo-orchestration
630656
vars:
657+
TOPOLOGY: "sharded_cluster"
631658
AUTH: "noauth"
632659
SSL: "nossl"
633660
- func: run-tests
634661
vars:
662+
TOPOLOGY: "sharded_cluster"
635663
AUTH: "noauth"
636664
SSL: "nossl"
637665
MONGO_GO_DRIVER_COMPRESSOR: "zlib"
@@ -641,10 +669,12 @@ tasks:
641669
commands:
642670
- func: bootstrap-mongo-orchestration
643671
vars:
672+
TOPOLOGY: "sharded_cluster"
644673
AUTH: "noauth"
645674
SSL: "nossl"
646675
- func: run-tests
647676
vars:
677+
TOPOLOGY: "sharded_cluster"
648678
AUTH: "noauth"
649679
SSL: "nossl"
650680
MONGO_GO_DRIVER_COMPRESSOR: "zstd"
@@ -654,10 +684,12 @@ tasks:
654684
commands:
655685
- func: bootstrap-mongo-orchestration
656686
vars:
687+
TOPOLOGY: "sharded_cluster"
657688
AUTH: "auth"
658689
SSL: "ssl"
659690
- func: run-tests
660691
vars:
692+
TOPOLOGY: "sharded_cluster"
661693
AUTH: "auth"
662694
SSL: "ssl"
663695

@@ -666,10 +698,12 @@ tasks:
666698
commands:
667699
- func: bootstrap-mongo-orchestration
668700
vars:
701+
TOPOLOGY: "sharded_cluster"
669702
AUTH: "auth"
670703
SSL: "ssl"
671704
- func: run-tests
672705
vars:
706+
TOPOLOGY: "sharded_cluster"
673707
AUTH: "auth"
674708
SSL: "ssl"
675709
MONGO_GO_DRIVER_COMPRESSOR: "snappy"
@@ -679,10 +713,12 @@ tasks:
679713
commands:
680714
- func: bootstrap-mongo-orchestration
681715
vars:
716+
TOPOLOGY: "sharded_cluster"
682717
AUTH: "auth"
683718
SSL: "ssl"
684719
- func: run-tests
685720
vars:
721+
TOPOLOGY: "sharded_cluster"
686722
AUTH: "auth"
687723
SSL: "ssl"
688724
MONGO_GO_DRIVER_COMPRESSOR: "zlib"
@@ -692,10 +728,12 @@ tasks:
692728
commands:
693729
- func: bootstrap-mongo-orchestration
694730
vars:
731+
TOPOLOGY: "sharded_cluster"
695732
AUTH: "auth"
696733
SSL: "ssl"
697734
- func: run-tests
698735
vars:
736+
TOPOLOGY: "sharded_cluster"
699737
AUTH: "auth"
700738
SSL: "ssl"
701739
MONGO_GO_DRIVER_COMPRESSOR: "zstd"

mongo/integration/mtest/mongotest.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,14 @@ func (t *T) createTestClient() {
507507
})
508508
// only specify connection pool monitor if no deployment is given
509509
if clientOpts.Deployment == nil {
510+
previousPoolMonitor := clientOpts.PoolMonitor
511+
510512
clientOpts.SetPoolMonitor(&event.PoolMonitor{
511513
Event: func(evt *event.PoolEvent) {
514+
if previousPoolMonitor != nil {
515+
previousPoolMonitor.Event(evt)
516+
}
517+
512518
switch evt.Type {
513519
case event.GetSucceeded:
514520
t.connsCheckedOut++

mongo/integration/primary_stepdown_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func TestConnectionsSurvivePrimaryStepDown(t *testing.T) {
6060
initCollection(mt, mt.Coll)
6161
cur, err := mt.Coll.Find(mtest.Background, bson.D{}, options.Find().SetBatchSize(2))
6262
assert.Nil(mt, err, "Find error: %v", err)
63+
defer cur.Close(mtest.Background)
6364
assert.True(mt, cur.Next(mtest.Background), "expected Next true, got false")
6465

6566
err = mt.Client.Database("admin").RunCommand(mtest.Background, bson.D{

0 commit comments

Comments
 (0)