From 21e958f681299e9a6b331e07d95d6bb4ad071b74 Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Tue, 12 Nov 2024 16:51:39 -0500 Subject: [PATCH] add task --- .evergreen/config.yml | 40 +++++++++++++++++++ Taskfile.yml | 3 ++ .../client_side_encryption_prose_test.go | 7 +++- 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 90da768350..a2e2235827 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -553,6 +553,31 @@ functions: KMS_MOCK_SERVERS_RUNNING: "true" args: [*task-runner, evg-test-kmip] + start-kms-failpoint-server: + - command: subprocess.exec + params: + binary: python3 + background: true + args: ["-u", "${DRIVERS_TOOLS}/.evergreen/csfle/kms_failpoint_server.py", "--port", "9003"] + + run-retry-kms-requests: + - command: subprocess.exec + type: test + params: + binary: "bash" + env: + GO_BUILD_TAGS: cse + include_expansions_in_env: [AUTH, SSL, MONGODB_URI, TOPOLOGY, + MONGO_GO_DRIVER_COMPRESSOR] + args: [*task-runner, setup-test] + - command: subprocess.exec + type: test + params: + binary: "bash" + env: + KMS_FAILPOINT_SERVERS_RUNNING: "true" + args: [*task-runner, evg-test-retry-kms-requests] + run-fuzz-tests: - command: subprocess.exec type: test @@ -1486,6 +1511,21 @@ tasks: AUTH: "noauth" SSL: "nossl" + - name: "test-retry-kms-requests" + tags: ["retry-kms-requests"] + commands: + - func: bootstrap-mongo-orchestration + vars: + TOPOLOGY: "server" + AUTH: "noauth" + SSL: "nossl" + - func: start-kms-failpoint-server + - func: run-retry-kms-requests + vars: + TOPOLOGY: "server" + AUTH: "noauth" + SSL: "nossl" + - name: "test-serverless" tags: ["serverless"] commands: diff --git a/Taskfile.yml b/Taskfile.yml index f22427a640..d93a7e4e9b 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -141,6 +141,9 @@ tasks: evg-test-kms: - 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 + evg-test-retry-kms-requests: + - 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 + evg-test-load-balancers: # Load balancer should be tested with all unified tests as well as tests in the following # components: retryable reads, retryable writes, change streams, initial DNS seedlist discovery. diff --git a/internal/integration/client_side_encryption_prose_test.go b/internal/integration/client_side_encryption_prose_test.go index 4b6966c47b..1d9173c30b 100644 --- a/internal/integration/client_side_encryption_prose_test.go +++ b/internal/integration/client_side_encryption_prose_test.go @@ -2983,7 +2983,12 @@ func TestClientSideEncryptionProse(t *testing.T) { }) }) - mt.RunOpts("24. KMS Retry Tests", qeRunOpts22, func(mt *mtest.T) { + mt.RunOpts("24. kms retry tests", qeRunOpts22, func(mt *mtest.T) { + kmsTlsTestcase := os.Getenv("KMS_FAILPOINT_SERVERS_RUNNING") + if kmsTlsTestcase == "" { + mt.Skipf("Skipping test as KMS_FAILPOINT_SERVERS_RUNNING is not set") + } + setFailPoint := func(failure string, count int) error { url := fmt.Sprintf("https://localhost:9003/set_failpoint/%s", failure) var payloadBuf bytes.Buffer