Skip to content

Fix test EncryptableFixtureTest that fails intermittently#42001

Merged
kamipo merged 1 commit intorails:mainfrom
ricardotk002:fix-encrypted-fixtures-test
Apr 17, 2021
Merged

Fix test EncryptableFixtureTest that fails intermittently#42001
kamipo merged 1 commit intorails:mainfrom
ricardotk002:fix-encrypted-fixtures-test

Conversation

@ricardotk002
Copy link
Contributor

Summary

Reference:

https://buildkite.com/rails/rails/builds/76506#f42a5ab3-1923-4a9f-b843-56c4098b6bef
https://buildkite.com/rails/rails/builds/76590#04721d73-9505-4c29-82bf-0a1be1f41649
https://buildkite.com/rails/rails/builds/76556#aa284ad0-0eab-48e9-a50b-60e3b5c7ccac

Apparently when loading different fixtures that reference the same
table, the files that are loaded last run a DELETE FROM statement
that removes previous data.

Reproduction command using minitest_bisect:

activerecord $ bin/test -a mysql2 --seed 22031 -n "/^(?:ActiveRecord::Encryption::EncryptableRecordTest#(?:test_when_downcase:_true_it_creates_content_downcased)|ActiveRecord::Encryption::EncryptableFixtureTest#(?:test_fixtures_get_encrypted_automatically))$/"

Reference:

https://buildkite.com/rails/rails/builds/76506#f42a5ab3-1923-4a9f-b843-56c4098b6bef
https://buildkite.com/rails/rails/builds/76590#04721d73-9505-4c29-82bf-0a1be1f41649
https://buildkite.com/rails/rails/builds/76556#aa284ad0-0eab-48e9-a50b-60e3b5c7ccac

Apparently when loading different fixtures that reference the same
table, the files that are loaded last run a `DELETE FROM` statement
that removes previous data.

Reproduction command using `minitest_bisect`:

```
activerecord $ bin/test -a mysql2 --seed 22031 -n "/^(?:ActiveRecord::Encryption::EncryptableRecordTest#(?:test_when_downcase:_true_it_creates_content_downcased)|ActiveRecord::Encryption::EncryptableFixtureTest#(?:test_fixtures_get_encrypted_automatically))$/"
```
@p8
Copy link
Member

p8 commented Apr 16, 2021

Hey @ricardotk002 , thanks for the PR.
I'm linking the reported issue: #41948

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ActiveRecord::Encryption::EncryptableFixtureTest#test_fixtures_get_encrypted_automatically fails

3 participants