-
Notifications
You must be signed in to change notification settings - Fork 21.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All tables are truncated when using tests in parallel. #38164
Comments
This issue has been automatically marked as stale because it has not been commented on for at least three months. |
I'm seeing the same issue, which wouldn't normally be a problem but it's nuking my PostGIS constants. |
Yes this caught me too. I was seeding my test database and this just wiped it again before the tests ran. |
This caught me as well. How are we supposed to seed the test database when using parallel tests? |
The issue was the postgis plugin.
…On Mon, Oct 25, 2021 at 11:49 AM flprben ***@***.***> wrote:
This caught me as well. How are we supposed to seed the test database when
using parallel tests?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#38164 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA6IB65XYKRCPIQL6UENU3UIWRB7ANCNFSM4KDF6JYA>
.
|
Anyone figure this out? Truncating all the tables in the database truncates |
Ah for anyone else who runs into this PostGIS adapter has its own |
An environment variable was added which skips the table truncation and mitigates this issue, see #51686 |
@cduez that works if all the tables don't need truncating and getting all the devs to set the variable. But that seem more just like a CI solution. A better solution would be a config setting. But for now patching the connection adapter ala Postgis Adapter works better |
I was wondering why rails was truncating all the tables only when the tests are executed in parallel using the :fork strategy and not with the :thread strategy?
I have noticed this after creating a new rails application with an already existing database: My first test was already taking seconds to run which didn't seem right. The test log showed that before the first test is executed, all the tables are truncated which take few seconds in my case.
When a fork is created rails calls the method:
rails/activerecord/lib/active_record/tasks/database_tasks.rb
Line 350 in 4fbb393
Would it be acceptable to do nothing if the schema is up to date in order to save some time?
System configuration
Rails version: 6.0.2.1
Ruby version: 2.6.5
The text was updated successfully, but these errors were encountered: