Skip to content

Commit

Permalink
Merge pull request #19553 from code-dot-org/s3_client_credential_fix
Browse files Browse the repository at this point in the history
Reset S3-client object after each test
  • Loading branch information
wjordan committed Jan 2, 2018
2 parents fc8f811 + 3d709e8 commit dd28203
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions shared/test/common_test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ def around(&block)
AWS::S3.stub(:random, proc {random.bytes(16).unpack('H*')[0]}, &block)
end
end

# Cached S3-client objects contain AWS credentials,
# so reset them to ensure that they are not reused across tests.
BucketHelper.s3 = nil
AWS::S3.s3 = nil

# Reset AUTO_INCREMENT, since it is unaffected by transaction rollback.
PEGASUS_TEST_TABLES.each do |table|
PEGASUS_DB.execute("ALTER TABLE `#{table}` AUTO_INCREMENT = 1")
Expand Down

0 comments on commit dd28203

Please sign in to comment.