Skip to content

Commit cfd7d58

Browse files
committed
add task
1 parent 02a60a5 commit cfd7d58

File tree

3 files changed

+63
-1
lines changed

3 files changed

+63
-1
lines changed

.evergreen/config.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,14 @@ functions:
536536
args: [*task-runner, evg-test-kms]
537537

538538
run-kmip-tests:
539+
- command: subprocess.exec
540+
params:
541+
working_dir: src/go.mongodb.org/mongo-driver
542+
binary: bash
543+
background: true
544+
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN", "DRIVERS_TOOLS"]
545+
# This cannot use task because it will hang on Windows.
546+
args: [etc/setup-encryption.sh]
539547
- command: subprocess.exec
540548
type: test
541549
params:
@@ -553,6 +561,31 @@ functions:
553561
KMS_MOCK_SERVERS_RUNNING: "true"
554562
args: [*task-runner, evg-test-kmip]
555563

564+
start-kms-failpoint-server:
565+
- command: subprocess.exec
566+
params:
567+
binary: python3
568+
background: true
569+
args: ["-u", "${DRIVERS_TOOLS}/.evergreen/csfle/kms_failpoint_server.py", "--port", "9003"]
570+
571+
run-retry-kms-requests:
572+
- command: subprocess.exec
573+
type: test
574+
params:
575+
binary: "bash"
576+
env:
577+
GO_BUILD_TAGS: cse
578+
include_expansions_in_env: [AUTH, SSL, MONGODB_URI, TOPOLOGY,
579+
MONGO_GO_DRIVER_COMPRESSOR]
580+
args: [*task-runner, setup-test]
581+
- command: subprocess.exec
582+
type: test
583+
params:
584+
binary: "bash"
585+
env:
586+
KMS_FAILPOINT_SERVERS_RUNNING: "true"
587+
args: [*task-runner, evg-test-retry-kms-requests]
588+
556589
run-fuzz-tests:
557590
- command: subprocess.exec
558591
type: test
@@ -1486,6 +1519,21 @@ tasks:
14861519
AUTH: "noauth"
14871520
SSL: "nossl"
14881521

1522+
- name: "test-retry-kms-requests"
1523+
tags: ["retry-kms-requests"]
1524+
commands:
1525+
- func: bootstrap-mongo-orchestration
1526+
vars:
1527+
TOPOLOGY: "server"
1528+
AUTH: "noauth"
1529+
SSL: "nossl"
1530+
- func: start-kms-failpoint-server
1531+
- func: run-retry-kms-requests
1532+
vars:
1533+
TOPOLOGY: "server"
1534+
AUTH: "noauth"
1535+
SSL: "nossl"
1536+
14891537
- name: "test-serverless"
14901538
tags: ["serverless"]
14911539
commands:
@@ -2195,6 +2243,12 @@ buildvariants:
21952243
tasks:
21962244
- name: ".kms-kmip"
21972245

2246+
- matrix_name: "retry-kms-requests-test"
2247+
matrix_spec: { version: ["7.0"], os-ssl-40: ["rhel87-64"] }
2248+
display_name: "Retry KMS Requests ${os-ssl-40}"
2249+
tasks:
2250+
- name: ".retry-kms-requests"
2251+
21982252
- matrix_name: "fuzz-test"
21992253
matrix_spec: { version: ["5.0"], os-ssl-40: ["rhel87-64"] }
22002254
display_name: "Fuzz ${version} ${os-ssl-40}"

Taskfile.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ tasks:
141141
evg-test-kms:
142142
- go test -exec "env PKG_CONFIG_PATH=${PKG_CONFIG_PATH} LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" ${BUILD_TAGS} -v -timeout {{.TEST_TIMEOUT}}s ./internal/integration -run TestClientSideEncryptionProse/kms_tls_tests >> test.suite
143143

144+
evg-test-retry-kms-requests:
145+
- go test -exec "env PKG_CONFIG_PATH=${PKG_CONFIG_PATH} LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" ${BUILD_TAGS} -v -timeout {{.TEST_TIMEOUT}}s ./internal/integration -run TestClientSideEncryptionProse/kms_retry_tests >> test.suite
146+
144147
evg-test-load-balancers:
145148
# Load balancer should be tested with all unified tests as well as tests in the following
146149
# components: retryable reads, retryable writes, change streams, initial DNS seedlist discovery.

internal/integration/client_side_encryption_prose_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2983,7 +2983,12 @@ func TestClientSideEncryptionProse(t *testing.T) {
29832983
})
29842984
})
29852985

2986-
mt.RunOpts("24. KMS Retry Tests", qeRunOpts22, func(mt *mtest.T) {
2986+
mt.RunOpts("24. kms retry tests", qeRunOpts22, func(mt *mtest.T) {
2987+
kmsTlsTestcase := os.Getenv("KMS_FAILPOINT_SERVERS_RUNNING")
2988+
if kmsTlsTestcase == "" {
2989+
mt.Skipf("Skipping test as KMS_FAILPOINT_SERVERS_RUNNING is not set")
2990+
}
2991+
29872992
setFailPoint := func(failure string, count int) error {
29882993
url := fmt.Sprintf("https://localhost:9003/set_failpoint/%s", failure)
29892994
var payloadBuf bytes.Buffer

0 commit comments

Comments
 (0)