The complete fix for intermittent t/750firebird.t failures (RT#110979)
[dbsrgits/DBIx-Class.git] / t / 750firebird.t
index 9a460ea..f5bd6e6 100644 (file)
@@ -36,18 +36,25 @@ plan skip_all => join (' ',
 
 my $schema;
 
-for my $prefix (keys %$env2optdep) { SKIP: {
+my @test_order = map { "DBICTEST_FIREBIRD$_" }
+  DBICTest::RunMode->is_plain
+    ? ('', '_INTERBASE', '_ODBC')   # Least likely to fail
+    : ('_ODBC', '_INTERBASE' , ''); # Most likely to fail
 
-  my ($dsn, $user, $pass) = map { $ENV{"${prefix}_$_"} } qw/DSN USER PASS/;
-
-  next unless $dsn;
-
-  note "Testing with ${prefix}_DSN";
+for my $prefix (@test_order) { SKIP: {
 
   skip ("Testing with ${prefix}_DSN needs " . DBIx::Class::Optional::Dependencies->req_missing_for( $env2optdep->{$prefix} ), 1)
     unless  DBIx::Class::Optional::Dependencies->req_ok_for($env2optdep->{$prefix});
 
-  $schema = DBICTest->connect_schema($dsn, $user, $pass, {
+  skip ("DBD::InterBase crashes if Firebird or ODBC are also loaded", 1)
+    if $prefix eq 'DBICTEST_FIREBIRD_INTERBASE' and
+      ($ENV{DBICTEST_FIREBIRD_DSN} or $ENV{DBICTEST_FIREBIRD_ODBC_DSN});
+
+  my ($dsn, $user, $pass) = map { $ENV{"${prefix}_$_"} } qw/DSN USER PASS/;
+
+  note "Testing with ${prefix}_DSN";
+
+  $schema = DBICTest::Schema->connect($dsn, $user, $pass, {
     auto_savepoint  => 1,
     quote_names     => 1,
     ($dsn !~ /ODBC/ ? (on_connect_call => 'use_softcommit') : ()),
@@ -271,9 +278,7 @@ EOF
     "id"     INT PRIMARY KEY,
     "bytea"  INT,
     "blob"   BLOB,
-    "blob2"  BLOB,
     "clob"   BLOB SUB_TYPE TEXT,
-    "clob2"  BLOB SUB_TYPE TEXT,
     "a_memo" INT
   )
   ]);