Skip to content

Commit 2ebf024

Browse files
committed
add task
1 parent 02a60a5 commit 2ebf024

File tree

3 files changed

+66
-1
lines changed

3 files changed

+66
-1
lines changed

.evergreen/config.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,42 @@ functions:
553553
KMS_MOCK_SERVERS_RUNNING: "true"
554554
args: [*task-runner, evg-test-kmip]
555555

556+
start-kms-failpoint-server:
557+
- command: ec2.assume_role
558+
params:
559+
role_arn: ${aws_test_secrets_role}
560+
- command: subprocess.exec
561+
params:
562+
working_dir: src/go.mongodb.org/mongo-driver
563+
binary: bash
564+
background: true
565+
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN", "DRIVERS_TOOLS"]
566+
# This cannot use task because it will hang on Windows.
567+
args: [etc/setup-encryption.sh]
568+
- command: subprocess.exec
569+
params:
570+
binary: python3
571+
background: true
572+
args: ["-u", "${DRIVERS_TOOLS}/.evergreen/csfle/kms_failpoint_server.py", "--port", "9003"]
573+
574+
run-retry-kms-requests:
575+
- command: subprocess.exec
576+
type: test
577+
params:
578+
binary: "bash"
579+
env:
580+
GO_BUILD_TAGS: cse
581+
include_expansions_in_env: [AUTH, SSL, MONGODB_URI, TOPOLOGY,
582+
MONGO_GO_DRIVER_COMPRESSOR]
583+
args: [*task-runner, setup-test]
584+
- command: subprocess.exec
585+
type: test
586+
params:
587+
binary: "bash"
588+
env:
589+
KMS_FAILPOINT_SERVERS_RUNNING: "true"
590+
args: [*task-runner, evg-test-retry-kms-requests]
591+
556592
run-fuzz-tests:
557593
- command: subprocess.exec
558594
type: test
@@ -1486,6 +1522,21 @@ tasks:
14861522
AUTH: "noauth"
14871523
SSL: "nossl"
14881524

1525+
- name: "test-retry-kms-requests"
1526+
tags: ["retry-kms-requests"]
1527+
commands:
1528+
- func: bootstrap-mongo-orchestration
1529+
vars:
1530+
TOPOLOGY: "server"
1531+
AUTH: "noauth"
1532+
SSL: "nossl"
1533+
- func: start-kms-failpoint-server
1534+
- func: run-retry-kms-requests
1535+
vars:
1536+
TOPOLOGY: "server"
1537+
AUTH: "noauth"
1538+
SSL: "nossl"
1539+
14891540
- name: "test-serverless"
14901541
tags: ["serverless"]
14911542
commands:
@@ -2195,6 +2246,12 @@ buildvariants:
21952246
tasks:
21962247
- name: ".kms-kmip"
21972248

2249+
- matrix_name: "retry-kms-requests-test"
2250+
matrix_spec: { version: ["7.0"], os-ssl-40: ["rhel87-64"] }
2251+
display_name: "Retry KMS Requests ${os-ssl-40}"
2252+
tasks:
2253+
- name: ".retry-kms-requests"
2254+
21982255
- matrix_name: "fuzz-test"
21992256
matrix_spec: { version: ["5.0"], os-ssl-40: ["rhel87-64"] }
22002257
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)