In Rails 6.0.0, new application will run tests in parallel by default. The number of parallel workers is customizable, and which one will have its own temporary database. I recommend reading the awesome pull request description. Good job!
This is similar to #find_or_create_by, but avoids querying the table first before attempting to insert a row. The new approach relies on unique constraints to try inserting a row first, and selecting later. This is very helpful to high throughput application that could have data changes between a SELECT and a INSERT.