diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 713c394b55..7144427790 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,33 +16,33 @@ jobs: fail-fast: false matrix: os: [ ubuntu-20.04 ] - ruby: ["2.7", "3.0", "3.1", "3.2"] - mongodb: ["4.4", "5.0", "6.0", "7.0"] + ruby: ["2.7", "3.0", "3.1", "3.2", "3.3"] + mongodb: ["4.4", "5.0", "6.0", "7.0", "8.0"] topology: [replica_set, sharded_cluster] include: - os: macos ruby: "2.7" - mongodb: "5.0" + mongodb: "7.0" topology: server - os: macos ruby: "3.0" - mongodb: "5.0" + mongodb: "7.0" topology: server - os: ubuntu-latest ruby: "2.7" - mongodb: "5.0" + mongodb: "7.0" topology: server - os: ubuntu-latest ruby: "3.1" - mongodb: "5.0" + mongodb: "7.0" topology: server - os: ubuntu-latest ruby: "3.2" - mongodb: "5.0" + mongodb: "7.0" topology: server - os: ubuntu-latest ruby: "3.2" - mongodb: "6.0" + mongodb: "8.0" topology: replica_set steps: - name: repo checkout diff --git a/lib/mongo/error/pool_cleared_error.rb b/lib/mongo/error/pool_cleared_error.rb index 6f8b493e1a..d52b1ae198 100644 --- a/lib/mongo/error/pool_cleared_error.rb +++ b/lib/mongo/error/pool_cleared_error.rb @@ -31,6 +31,7 @@ class PoolClearedError < PoolError # # @api private def initialize(address, pool) + add_label('TransientTransactionError') super(address, pool, "Connection to #{address} interrupted due to server monitor timeout " + "(for pool 0x#{pool.object_id})") diff --git a/spec/mongo/error/pool_cleared_error_spec.rb b/spec/mongo/error/pool_cleared_error_spec.rb new file mode 100644 index 0000000000..38a3d6a9e3 --- /dev/null +++ b/spec/mongo/error/pool_cleared_error_spec.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require 'lite_spec_helper' + +describe Mongo::Error::PoolClearedError do + describe '#initialize' do + let(:error) do + described_class.new( + instance_double(Mongo::Address), instance_double(Mongo::Server::ConnectionPool) + ) + end + + it 'appends TransientTransactionError' do + expect(error.labels).to include('TransientTransactionError') + end + end +end