Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit c11e9c2

Browse files
committed
Trying to fix MySQL/Docker related issues.
1 parent 42bc67f commit c11e9c2

8 files changed

Lines changed: 69 additions & 67 deletions

File tree

extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MariaDbEntityStoreTest.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
import com.github.junit5docker.Environment;
2424
import com.github.junit5docker.Port;
2525
import com.github.junit5docker.WaitFor;
26-
import java.lang.reflect.UndeclaredThrowableException;
2726
import org.apache.polygene.api.common.Visibility;
28-
import org.apache.polygene.bootstrap.AssemblyException;
2927
import org.apache.polygene.bootstrap.ModuleAssembly;
3028
import org.apache.polygene.entitystore.sql.assembly.MariaDbSQLEntityStoreAssembler;
3129
import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
@@ -44,23 +42,17 @@
4442
@Environment( key = "MYSQL_ALLOW_EMPTY_PASSWORD", value = "yes" ),
4543
@Environment( key = "MYSQL_DATABASE", value = "jdbc_test_db" )
4644
},
47-
waitFor = @WaitFor( value = "mariadb.org binary distribution", timeoutInMillis = 30000 ),
45+
waitFor = @WaitFor( value = "mariadb.org binary distribution", timeoutInMillis = 120000 ),
4846
newForEachCase = false
4947
)
5048
public class MariaDbEntityStoreTest extends AbstractEntityStoreTest
5149
{
5250

5351
@BeforeAll
54-
public static void waitForDockerToSettle()
52+
static void waitForDockerToSettle()
53+
throws Exception
5554
{
56-
try
57-
{
58-
Thread.sleep( 5000 );
59-
}
60-
catch( InterruptedException e )
61-
{
62-
throw new UndeclaredThrowableException( e );
63-
}
55+
Thread.sleep( 15000 );
6456
}
6557

6658
@Override
@@ -100,7 +92,7 @@ public void assemble( ModuleAssembly module )
10092
DataSourceConfiguration defaults = config.forMixin( DataSourceConfiguration.class ).declareDefaults();
10193
defaults.url().set( "jdbc:mysql://" + host + ":" + port
10294
+ "/jdbc_test_db?profileSQL=false&useLegacyDatetimeCode=false&serverTimezone=UTC"
103-
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true" );
95+
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true&useSSL=false" );
10496
defaults.driver().set( "com.mysql.jdbc.Driver" );
10597
defaults.enabled().set( true );
10698
defaults.username().set( "root" );

extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MariaDbEntityStoreTestSuite.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.github.junit5docker.Environment;
2424
import com.github.junit5docker.Port;
2525
import com.github.junit5docker.WaitFor;
26-
import java.lang.reflect.UndeclaredThrowableException;
2726
import org.apache.polygene.api.common.Visibility;
2827
import org.apache.polygene.bootstrap.ModuleAssembly;
2928
import org.apache.polygene.entitystore.sql.assembly.MySQLEntityStoreAssembler;
@@ -42,22 +41,16 @@
4241
@Environment( key = "MYSQL_ALLOW_EMPTY_PASSWORD", value = "yes" ),
4342
@Environment( key = "MYSQL_DATABASE", value = "jdbc_test_db" )
4443
},
45-
waitFor = @WaitFor( value = "mariadb.org binary distribution", timeoutInMillis = 30000 ),
44+
waitFor = @WaitFor( value = "mariadb.org binary distribution", timeoutInMillis = 120000 ),
4645
newForEachCase = false
4746
)
4847
public class MariaDbEntityStoreTestSuite extends EntityStoreTestSuite
4948
{
5049
@BeforeAll
5150
static void waitForDockerToSettle()
51+
throws Exception
5252
{
53-
try
54-
{
55-
Thread.sleep( 5000 );
56-
}
57-
catch( InterruptedException e )
58-
{
59-
throw new UndeclaredThrowableException( e );
60-
}
53+
Thread.sleep( 15000 );
6154
}
6255

6356
@Override
@@ -91,7 +84,7 @@ protected void defineStorageModule( ModuleAssembly module )
9184
defaults
9285
.url().set( "jdbc:mysql://" + mysqlHost + ":" + mysqlPort
9386
+ "/jdbc_test_db?profileSQL=false&useLegacyDatetimeCode=false&serverTimezone=UTC"
94-
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true" );
87+
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true&useSSL=false" );
9588
defaults.driver().set( "com.mysql.jdbc.Driver" );
9689
defaults.enabled().set( true );
9790
defaults.username().set( "root" );

extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MySQLEntityStoreTest.java

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import com.github.junit5docker.WaitFor;
2626
import java.lang.reflect.UndeclaredThrowableException;
2727
import org.apache.polygene.api.common.Visibility;
28-
import org.apache.polygene.bootstrap.AssemblyException;
2928
import org.apache.polygene.bootstrap.ModuleAssembly;
3029
import org.apache.polygene.entitystore.sql.assembly.MySQLEntityStoreAssembler;
3130
import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
@@ -37,30 +36,24 @@
3736
import org.junit.jupiter.api.AfterEach;
3837
import org.junit.jupiter.api.BeforeAll;
3938

40-
@Docker( image = "mysql:8.0.11",
39+
// If upgrade to MySQL 8, then these tests will fail due to some new authentication requirements.
40+
@Docker( image = "mysql:5.7.22",
4141
ports = @Port( exposed = 8801, inner = 3306 ),
4242
environments = {
4343
@Environment( key = "MYSQL_ROOT_PASSWORD", value = "" ),
4444
@Environment( key = "MYSQL_ALLOW_EMPTY_PASSWORD", value = "yes" ),
4545
@Environment( key = "MYSQL_DATABASE", value = "jdbc_test_db" )
4646
},
47-
waitFor = @WaitFor( value = "mysqld: ready for connections", timeoutInMillis = 40000 ),
47+
waitFor = @WaitFor( value = "ready for connections", timeoutInMillis = 90000 ),
4848
newForEachCase = false
4949
)
50-
public class MySQLEntityStoreTest
51-
extends AbstractEntityStoreTest
50+
public class MySQLEntityStoreTest extends AbstractEntityStoreTest
5251
{
5352
@BeforeAll
54-
public static void waitForDockerToSettle()
53+
static void waitForDockerToSettle()
54+
throws Exception
5555
{
56-
try
57-
{
58-
Thread.sleep( 10000 );
59-
}
60-
catch( InterruptedException e )
61-
{
62-
throw new UndeclaredThrowableException( e );
63-
}
56+
Thread.sleep( 30000 );
6457
}
6558

6659
@Override
@@ -100,7 +93,7 @@ public void assemble( ModuleAssembly module )
10093
DataSourceConfiguration defaults = config.forMixin( DataSourceConfiguration.class ).declareDefaults();
10194
defaults.url().set( "jdbc:mysql://" + mysqlHost + ":" + mysqlPort
10295
+ "/jdbc_test_db?profileSQL=false&useLegacyDatetimeCode=false&serverTimezone=UTC"
103-
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true" );
96+
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true&useSSL=false" );
10497
defaults.driver().set( "com.mysql.jdbc.Driver" );
10598
defaults.enabled().set( true );
10699
defaults.username().set( "root" );

extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MySQLEntityStoreTestSuite.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.github.junit5docker.Environment;
2424
import com.github.junit5docker.Port;
2525
import com.github.junit5docker.WaitFor;
26-
import java.lang.reflect.UndeclaredThrowableException;
2726
import org.apache.polygene.api.common.Visibility;
2827
import org.apache.polygene.bootstrap.ModuleAssembly;
2928
import org.apache.polygene.entitystore.sql.assembly.MySQLEntityStoreAssembler;
@@ -35,7 +34,8 @@
3534
import org.junit.jupiter.api.AfterEach;
3635
import org.junit.jupiter.api.BeforeAll;
3736

38-
@Docker( image = "mysql:8.0.11",
37+
// If upgrade to MySQL 8, then these tests will fail due to some new authentication requirements.
38+
@Docker( image = "mysql:5.7.22",
3939
ports = @Port( exposed = 8801, inner = 3306 ),
4040
environments = {
4141
@Environment( key = "MYSQL_ROOT_PASSWORD", value = "" ),
@@ -48,16 +48,10 @@
4848
public class MySQLEntityStoreTestSuite extends EntityStoreTestSuite
4949
{
5050
@BeforeAll
51-
public static void waitForDockerToSettle()
51+
static void waitForDockerToSettle()
52+
throws Exception
5253
{
53-
try
54-
{
55-
Thread.sleep( 12000 );
56-
}
57-
catch( InterruptedException e )
58-
{
59-
throw new UndeclaredThrowableException( e );
60-
}
54+
Thread.sleep( 12000 );
6155
}
6256

6357
@Override
@@ -90,7 +84,7 @@ protected void defineStorageModule( ModuleAssembly module )
9084
DataSourceConfiguration defaults = configModule.forMixin( DataSourceConfiguration.class ).declareDefaults();
9185
defaults.url().set( "jdbc:mysql://" + mysqlHost + ":" + mysqlPort
9286
+ "/jdbc_test_db?profileSQL=false&useLegacyDatetimeCode=false&serverTimezone=UTC"
93-
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true" );
87+
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true&useSSL=false" );
9488
defaults.driver().set( "com.mysql.jdbc.Driver" );
9589
defaults.enabled().set( true );
9690
defaults.username().set( "root" );

extensions/entitystore-sqlkv/src/test/java/org/apache/polygene/entitystore/sqlkv/MariaDbEntityStoreTest.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.github.junit5docker.Port;
2525
import com.github.junit5docker.WaitFor;
2626
import org.apache.polygene.api.common.Visibility;
27-
import org.apache.polygene.bootstrap.AssemblyException;
2827
import org.apache.polygene.bootstrap.ModuleAssembly;
2928
import org.apache.polygene.entitystore.sqlkv.assembly.MySQLEntityStoreAssembler;
3029
import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
@@ -34,20 +33,27 @@
3433
import org.apache.polygene.test.entity.AbstractEntityStoreTest;
3534
import org.jooq.SQLDialect;
3635
import org.junit.jupiter.api.AfterEach;
37-
import org.junit.jupiter.api.Disabled;
36+
import org.junit.jupiter.api.BeforeAll;
3837

3938
@Docker( image = "mariadb:10.1.21",
40-
ports = @Port( exposed = 8801, inner = 3306),
39+
ports = @Port( exposed = 8801, inner = 3306 ),
4140
environments = {
42-
@Environment( key = "MYSQL_ROOT_PASSWORD", value = ""),
43-
@Environment(key = "MYSQL_ALLOW_EMPTY_PASSWORD", value = "yes"),
44-
@Environment(key = "MYSQL_DATABASE", value = "jdbc_test_db"),
41+
@Environment( key = "MYSQL_ROOT_PASSWORD", value = "" ),
42+
@Environment( key = "MYSQL_ALLOW_EMPTY_PASSWORD", value = "yes" ),
43+
@Environment( key = "MYSQL_DATABASE", value = "jdbc_test_db" ),
4544
},
46-
waitFor = @WaitFor( value = "mysqld: ready for connections",timeoutInMillis = 30000),
45+
waitFor = @WaitFor( value = "mysqld: ready for connections", timeoutInMillis = 120000 ),
4746
newForEachCase = false
4847
)
4948
public class MariaDbEntityStoreTest extends AbstractEntityStoreTest
5049
{
50+
@BeforeAll
51+
static void waitForDockerToSettle()
52+
throws Exception
53+
{
54+
Thread.sleep( 15000L );
55+
}
56+
5157
@Override
5258
// START SNIPPET: assembly
5359
public void assemble( ModuleAssembly module )
@@ -85,7 +91,7 @@ public void assemble( ModuleAssembly module )
8591
config.forMixin( DataSourceConfiguration.class ).declareDefaults()
8692
.url().set( "jdbc:mysql://" + mysqlHost + ":" + mysqlPort
8793
+ "/jdbc_test_db?profileSQL=false&useLegacyDatetimeCode=false&serverTimezone=UTC"
88-
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true" );
94+
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true&useSSL=false" );
8995
// START SNIPPET: assembly
9096
}
9197
// END SNIPPET: assembly

extensions/entitystore-sqlkv/src/test/java/org/apache/polygene/entitystore/sqlkv/MariaDbEntityStoreTestSuite.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.apache.polygene.test.entity.model.EntityStoreTestSuite;
3333
import org.jooq.SQLDialect;
3434
import org.junit.jupiter.api.AfterEach;
35+
import org.junit.jupiter.api.BeforeAll;
3536
import org.junit.jupiter.api.Disabled;
3637

3738
@Docker( image = "mariadb:10.1.21",
@@ -41,11 +42,18 @@
4142
@Environment(key = "MYSQL_ALLOW_EMPTY_PASSWORD", value = "yes"),
4243
@Environment(key = "MYSQL_DATABASE", value = "jdbc_test_db"),
4344
},
44-
waitFor = @WaitFor( value = "mysqld: ready for connections", timeoutInMillis = 30000),
45+
waitFor = @WaitFor( value = "mysqld: ready for connections", timeoutInMillis = 120000),
4546
newForEachCase = false
4647
)
4748
public class MariaDbEntityStoreTestSuite extends EntityStoreTestSuite
4849
{
50+
@BeforeAll
51+
static void waitForDockerToSettle()
52+
throws Exception
53+
{
54+
Thread.sleep( 15000L );
55+
}
56+
4957
@Override
5058
protected void defineStorageModule( ModuleAssembly module )
5159
{
@@ -76,7 +84,7 @@ protected void defineStorageModule( ModuleAssembly module )
7684
configModule.forMixin( DataSourceConfiguration.class ).declareDefaults()
7785
.url().set( "jdbc:mysql://" + mysqlHost + ":" + mysqlPort
7886
+ "/jdbc_test_db?profileSQL=false&useLegacyDatetimeCode=false&serverTimezone=UTC"
79-
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true" );
87+
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true&useSSL=false" );
8088
}
8189

8290
@Override

extensions/entitystore-sqlkv/src/test/java/org/apache/polygene/entitystore/sqlkv/MySQLEntityStoreTest.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,28 @@
3434
import org.apache.polygene.test.entity.AbstractEntityStoreTest;
3535
import org.jooq.SQLDialect;
3636
import org.junit.jupiter.api.AfterEach;
37+
import org.junit.jupiter.api.BeforeAll;
3738
import org.junit.jupiter.api.Disabled;
3839

39-
@Docker( image = "mysql:8.0.11",
40+
@Docker( image = "mysql:5.7.22",
4041
ports = @Port( exposed = 8801, inner = 3306),
4142
environments = {
4243
@Environment( key = "MYSQL_ROOT_PASSWORD", value = ""),
4344
@Environment(key = "MYSQL_ALLOW_EMPTY_PASSWORD", value = "yes"),
4445
@Environment(key = "MYSQL_DATABASE", value = "jdbc_test_db"),
4546
},
46-
waitFor = @WaitFor( value = "mysqld: ready for connections", timeoutInMillis = 30000),
47+
waitFor = @WaitFor( value = "mysqld: ready for connections", timeoutInMillis = 90000),
4748
newForEachCase = false
4849
)
4950
public class MySQLEntityStoreTest extends AbstractEntityStoreTest
5051
{
52+
@BeforeAll
53+
static void waitForDockerToSettle()
54+
throws Exception
55+
{
56+
Thread.sleep( 15000 );
57+
}
58+
5159
@Override
5260
// START SNIPPET: assembly
5361
public void assemble( ModuleAssembly module )
@@ -85,7 +93,7 @@ public void assemble( ModuleAssembly module )
8593
config.forMixin( DataSourceConfiguration.class ).declareDefaults()
8694
.url().set( "jdbc:mysql://" + mysqlHost + ":" + mysqlPort
8795
+ "/jdbc_test_db?profileSQL=false&useLegacyDatetimeCode=false&serverTimezone=UTC"
88-
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true" );
96+
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true&useSSL=false" );
8997
// START SNIPPET: assembly
9098
}
9199
// END SNIPPET: assembly

extensions/entitystore-sqlkv/src/test/java/org/apache/polygene/entitystore/sqlkv/MySQLEntityStoreTestSuite.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,28 @@
3232
import org.apache.polygene.test.entity.model.EntityStoreTestSuite;
3333
import org.jooq.SQLDialect;
3434
import org.junit.jupiter.api.AfterEach;
35+
import org.junit.jupiter.api.BeforeAll;
3536
import org.junit.jupiter.api.Disabled;
3637

37-
@Docker( image = "mysql:8.0.11",
38+
@Docker( image = "mysql:5.7.22",
3839
ports = @Port( exposed = 8801, inner = 3306),
3940
environments = {
4041
@Environment( key = "MYSQL_ROOT_PASSWORD", value = ""),
4142
@Environment(key = "MYSQL_ALLOW_EMPTY_PASSWORD", value = "yes"),
4243
@Environment(key = "MYSQL_DATABASE", value = "jdbc_test_db"),
4344
},
44-
waitFor = @WaitFor( value = "mysqld: ready for connections", timeoutInMillis = 30000),
45+
waitFor = @WaitFor( value = "mysqld: ready for connections", timeoutInMillis = 90000),
4546
newForEachCase = false
4647
)
4748
public class MySQLEntityStoreTestSuite extends EntityStoreTestSuite
4849
{
50+
@BeforeAll
51+
static void waitForDockerToSettle()
52+
throws Exception
53+
{
54+
Thread.sleep( 15000 );
55+
}
56+
4957
@Override
5058
protected void defineStorageModule( ModuleAssembly module )
5159
{
@@ -76,7 +84,7 @@ protected void defineStorageModule( ModuleAssembly module )
7684
configModule.forMixin( DataSourceConfiguration.class ).declareDefaults()
7785
.url().set( "jdbc:mysql://" + mysqlHost + ":" + mysqlPort
7886
+ "/jdbc_test_db?profileSQL=false&useLegacyDatetimeCode=false&serverTimezone=UTC"
79-
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true" );
87+
+ "&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true&useSSL=false" );
8088
}
8189

8290
@Override

0 commit comments

Comments
 (0)