Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions gems/aws-sdk-core/spec/aws/login_credentials_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,14 @@ module Aws
expect(creds.credentials.secret_access_key).to eq('new_secret')
expect(creds.credentials.session_token).to eq('new_token')
expect(creds.credentials.account_id).to eq('0123456789012')
expect(creds.expiration).to eq(Time.parse(new_expiration))
expect(creds.expiration).to eq(Time.parse(expiration) + 60 + 900)
end
end

context 'expired token with refresh token' do
let(:old_expiration) { (Time.now.utc + 60).to_datetime.rfc3339 }
let(:new_expiration) { (Time.now.utc + 900).to_datetime.rfc3339 }
let(:time) { Time.parse('2026-01-01 00:00:00 UTC') }
let(:old_expiration) { (time + 60).to_datetime.rfc3339 }
let(:new_expiration) { (time + 900).to_datetime.rfc3339 }

let(:cached_token) do
{
Expand Down Expand Up @@ -178,16 +179,17 @@ module Aws
secret_access_key: 'new_secret',
session_token: 'new_token'
},
token_type: "aws_sigv4",
token_type: 'aws_sigv4',
expires_in: 900,
refresh_token: "new_refresh_token",
refresh_token: 'new_refresh_token',
id_token: 'identity_token'
}
}
end

before do
allow_any_instance_of(LoginCredentials).to receive(:warn).with(/WARNING: OpenSSL 3.6.x/)
allow(Time).to receive(:now).and_return(time)
end

it 'refreshes the token' do
Expand Down
2 changes: 1 addition & 1 deletion gems/aws-sdk-s3/spec/multipart_file_uploader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module S3
expect { subject.upload(large_file, params) }.to raise_error(/multipart upload failed: part 3 failed/)
end

it 'reports when it is unable to abort a failed multipart upload' do
it 'reports when it is unable to abort a failed multipart upload', :jruby_flaky do
client.stub_responses(:upload_part, RuntimeError.new('part failed'))
client.stub_responses(:abort_multipart_upload, RuntimeError.new('network-error'))
expect do
Expand Down
Loading