From: Dagfinn Ilmari Mannsåker Date: Tue, 10 Oct 2017 14:25:33 +0000 (+0100) Subject: Disconnect before dropping tables in tests X-Git-Tag: 0.07048~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c700ee3cad0ef31fad1d50db6990f0d9f65cac94;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Disconnect before dropping tables in tests The table dropping methods create their own database connections, so make sure the main one is down before that. Firebird 3.0 hangs when dropping views otherwise. --- diff --git a/t/lib/dbixcsl_common_tests.pm b/t/lib/dbixcsl_common_tests.pm index e3851f3..ca41f74 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -181,12 +181,12 @@ sub run_only_extra_tests { $self->test_data_types($conn); $self->{extra}{run}->($conn, $monikers, $classes, $self) if $self->{extra}{run}; + $conn->storage->disconnect; if (not ($ENV{SCHEMA_LOADER_TESTS_NOCLEANUP} && $info_idx == $#$connect_info)) { $self->drop_extra_tables_only; rmtree DUMP_DIR; } - $conn->storage->disconnect; } } @@ -1389,9 +1389,9 @@ TODO: { diag $@ if $@ && (not $TODO); } - $self->drop_tables unless $ENV{SCHEMA_LOADER_TESTS_NOCLEANUP}; - $conn->storage->disconnect; + + $self->drop_tables unless $ENV{SCHEMA_LOADER_TESTS_NOCLEANUP}; } sub test_data_types {