Skip to content

Commit 8c2daca

Browse files
RUBY-3806 Stabilize flaky CI tests and variants (#3025)
1 parent f68d676 commit 8c2daca

5 files changed

Lines changed: 60 additions & 30 deletions

File tree

.evergreen/config.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,8 @@ buildvariants:
11611161
- matrix_name: "ruby-dev"
11621162
matrix_spec:
11631163
ruby: "ruby-dev"
1164-
mongodb-version: ["8.0", "7.0"]
1164+
# MongoDB 7.0 enterprise archive is not published for ubuntu2404.
1165+
mongodb-version: "8.0"
11651166
topology: "replica-set"
11661167
os: ubuntu2404
11671168
display_name: "${mongodb-version} ${os} ${topology} ${auth-and-ssl} ${ruby}"
@@ -1382,17 +1383,19 @@ buildvariants:
13821383
# tasks:
13831384
# - name: "test-mlaunch"
13841385

1385-
- matrix_name: "jruby-auth"
1386-
matrix_spec:
1387-
auth-and-ssl: [ "auth-and-ssl", "noauth-and-nossl" ]
1388-
ruby: jruby-9.4
1389-
mongodb-version: "8.0"
1390-
topology: ["standalone", "replica-set", "sharded-cluster"]
1391-
os: ubuntu2204
1392-
display_name: "${mongodb-version} ${topology} ${auth-and-ssl} ${ruby}"
1393-
tags: ["pr"]
1394-
tasks:
1395-
- name: "run-main-test-suite"
1386+
# RUBY-3808: disabled — widespread TLS/EBADF failures on jruby-openssl.
1387+
# Re-enable once the jruby + TLS stack is investigated.
1388+
# - matrix_name: "jruby-auth"
1389+
# matrix_spec:
1390+
# auth-and-ssl: [ "auth-and-ssl", "noauth-and-nossl" ]
1391+
# ruby: <%= jrubies.first %>
1392+
# mongodb-version: <%= latest_stable_mdb %>
1393+
# topology: <%= topologies %>
1394+
# os: ubuntu2204
1395+
# display_name: "${mongodb-version} ${topology} ${auth-and-ssl} ${ruby}"
1396+
# tags: ["pr"]
1397+
# tasks:
1398+
# - name: "run-main-test-suite"
13961399

13971400
- matrix_name: zlib-"ruby-4.0"
13981401
matrix_spec:

.evergreen/config/standard.yml.erb

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ buildvariants:
3939
- matrix_name: "ruby-dev"
4040
matrix_spec:
4141
ruby: "ruby-dev"
42-
mongodb-version: <%= recent_mdb %>
42+
# MongoDB 7.0 enterprise archive is not published for ubuntu2404.
43+
mongodb-version: <%= latest_stable_mdb %>
4344
topology: "replica-set"
4445
os: ubuntu2404
4546
display_name: "${mongodb-version} ${os} ${topology} ${auth-and-ssl} ${ruby}"
@@ -260,17 +261,19 @@ buildvariants:
260261
# tasks:
261262
# - name: "test-mlaunch"
262263

263-
- matrix_name: "jruby-auth"
264-
matrix_spec:
265-
auth-and-ssl: [ "auth-and-ssl", "noauth-and-nossl" ]
266-
ruby: <%= jrubies.first %>
267-
mongodb-version: <%= latest_stable_mdb %>
268-
topology: <%= topologies %>
269-
os: ubuntu2204
270-
display_name: "${mongodb-version} ${topology} ${auth-and-ssl} ${ruby}"
271-
tags: ["pr"]
272-
tasks:
273-
- name: "run-main-test-suite"
264+
# RUBY-3808: disabled — widespread TLS/EBADF failures on jruby-openssl.
265+
# Re-enable once the jruby + TLS stack is investigated.
266+
# - matrix_name: "jruby-auth"
267+
# matrix_spec:
268+
# auth-and-ssl: [ "auth-and-ssl", "noauth-and-nossl" ]
269+
# ruby: <%%= jrubies.first %>
270+
# mongodb-version: <%%= latest_stable_mdb %>
271+
# topology: <%%= topologies %>
272+
# os: ubuntu2204
273+
# display_name: "${mongodb-version} ${topology} ${auth-and-ssl} ${ruby}"
274+
# tags: ["pr"]
275+
# tasks:
276+
# - name: "run-main-test-suite"
274277

275278
<% [
276279
[latest_ruby, stable_and_rapid, 'ubuntu2204'],

spec/integration/client_side_operations_timeout/encryption_prose_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
let(:key_vault_client) do
5050
ClientRegistry.instance.new_local_client(
5151
SpecConfig.instance.addresses,
52-
SpecConfig.instance.test_options.merge(timeout_ms: 20)
52+
SpecConfig.instance.test_options.merge(timeout_ms: 50)
5353
)
5454
end
5555

@@ -73,7 +73,7 @@
7373
data: {
7474
failCommands: [ 'insert' ],
7575
blockConnection: true,
76-
blockTimeMS: 30
76+
blockTimeMS: 200
7777
}
7878
})
7979
end
@@ -107,7 +107,7 @@
107107
data: {
108108
failCommands: [ 'find' ],
109109
blockConnection: true,
110-
blockTimeMS: 30
110+
blockTimeMS: 200
111111
}
112112
})
113113
end

spec/runners/unified/test.rb

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,23 @@ def initialize(spec, **opts)
6161

6262
attr_reader :test_spec, :description, :outcome, :skip_reason, :reqs, :group_reqs, :options, :entities
6363

64+
# Descriptions of unified spec tests that are known to flake under load on
65+
# CI and benefit from being retried. See the corresponding JIRA tickets for
66+
# the underlying investigations.
67+
RETRY_PATTERNS = Regexp.union(
68+
/KMS/i,
69+
# RUBY-3809: CSOT deprecated-options "maxTimeMS is ignored if timeoutMS
70+
# is set" operations occasionally observe a drifted maxTimeMS on the
71+
# wire when the CI host is loaded.
72+
/maxTimeMS is ignored if timeoutMS is set/i,
73+
# RUBY-3810: sharded mongos-pin-auto "remain pinned after non-transient"
74+
# tests flake when the server injects its own transient transaction
75+
# condition around the failCommand-injected error.
76+
/remain pinned after non-transient/i
77+
).freeze
78+
6479
def retry?
65-
@description =~ /KMS/i
80+
@description =~ RETRY_PATTERNS
6681
end
6782

6883
def skip?
@@ -424,6 +439,13 @@ def cleanup
424439
entities[:client]&.each do |_id, client|
425440
client.close
426441
end
442+
443+
# Reset entity state so that retry_test re-runs (RUBY-3809, RUBY-3810)
444+
# build fresh clients/sessions instead of reusing the closed ones
445+
# produced by the previous attempt. Without this, retried transactional
446+
# tests hit TRANSACTION_ALREADY_IN_PROGRESS on the stale session.
447+
@entities = EntityMap.new
448+
@entities_created = false
427449
end
428450

429451
private

spec/spec_tests/data/unified/valid-pass/poc-transactions-convenient-api.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ description: "poc-transactions-convenient-api"
22

33
schemaVersion: "1.0"
44

5+
# RUBY-3806: all tests in this file are flaky on sharded clusters due to
6+
# MigrationConflict during catalog changes forcing a withTransaction retry
7+
# that violates the strict expectEvents assertions. Restrict to replicaset
8+
# until the spec or the runner can tolerate transient-transaction retries.
59
runOnRequirements:
610
- minServerVersion: "4.0"
711
topologies: [ replicaset ]
8-
- minServerVersion: "4.1.8"
9-
topologies: [ sharded ]
1012

1113
createEntities:
1214
- client:

0 commit comments

Comments
 (0)