airlift / testing-mysql-server Goto Github PK
View Code? Open in Web Editor NEWEmbedded MySQL server for use in tests
License: Apache License 2.0
Embedded MySQL server for use in tests
License: Apache License 2.0
This does not work on Windows because the underlying mysql package looks for the mysql libraries at: Win-x86. Unfortunately, the name of the os will be something like Windows_8. This can be fixed by adding a platform-map.properties resource with mappings like: Windows_8-amd64=Win-x86
Further to port presto-mysql to ppc64le VM, package fails as the internally used testing-mysql-server does not have support for ppc64le. (Please refer to earlier issue: prestodb/presto#6152)
As part of providing the support. Edited the mysql-connector-mxj-db-files-5.0.12.jar created when the package builds.
Changes done were to create a 'Linuz-ppc64le' folder in the jar and copy the ppc64le compatible mysql and mysqld file into it.
As mentioned on the issue, would need testing-mysql-server to support ppc64le.
Tried to clone and build testing-mysql-server.
Steps followed:
git clone https://github.com/airlift/testing-mysql-server
mvn clean install -DskipTests
Build failed with the following error
[DEBUG] Findbugs arg is /testing-mysql-server/target/classes
[java] The following errors occurred during analysis:
[java] Nov 14, 2016 12:25:36 PM edu.umd.cs.findbugs.TextUIBugReporter reportAnalysisError
[java] SEVERE: Unable to get XClass for java/lang/StringBuilder
[java] java.lang.ArrayIndexOutOfBoundsException: 20993
[java] at org.objectweb.asm.ClassReader.readClass(Unknown Source)
[java] at org.objectweb.asm.ClassReader.accept(Unknown Source)
[java] at edu.umd.cs.findbugs.asm.FBClassReader.accept(FBClassReader.java:44)
[java] at org.objectweb.asm.ClassReader.accept(Unknown Source)
[java] at edu.umd.cs.findbugs.classfile.engine.ClassParserUsingASM.parse(ClassParserUsingASM.java:110)
[java] at edu.umd.cs.findbugs.classfile.engine.ClassParserUsingASM.parse(ClassParserUsingASM.java:554)
[java] at edu.umd.cs.findbugs.classfile.engine.ClassInfoAnalysisEngine.analyze(ClassInfoAnalysisEngine.java:76)
[java] at edu.umd.cs.findbugs.classfile.engine.ClassInfoAnalysisEngine.analyze(ClassInfoAnalysisEngine.java:38)
[java] at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getClassAnalysis(AnalysisCache.java:266)
[java] at edu.umd.cs.findbugs.ba.XFactory.getXClass(XFactory.java:652)
[java] at edu.umd.cs.findbugs.ba.ch.Subtypes2.addInheritanceEdge(Subtypes2.java:1227)
[java] at edu.umd.cs.findbugs.ba.ch.Subtypes2.addSupertypeEdges(Subtypes2.java:1200)
[java] at edu.umd.cs.findbugs.ba.ch.Subtypes2.addClassAndGetClassVertex(Subtypes2.java:275)
[java] at edu.umd.cs.findbugs.ba.ch.Subtypes2.addClass(Subtypes2.java:244)
[java] at edu.umd.cs.findbugs.ba.AnalysisCacheToAnalysisContextAdapter.setAppClassList(AnalysisCacheToAnalysisContextAdapter.java:400)
[java] at edu.umd.cs.findbugs.FindBugs2.setAppClassList(FindBugs2.java:982)
[java] at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:225)
[java] at edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:391)
[java] at edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1300)
[java] Unable to get XClass for java/lang/StringBuilder
Hi,
below are the full logs for test case failure, could you please help me out to fix these error.
~/testing-mysql-server# mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building testing-mysql-server 0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ testing-mysql-server ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (default) @ testing-mysql-server ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-maven) @ testing-mysql-server ---
[INFO]
[INFO] --- maven-dependency-versions-check-plugin:2.0.2:check (default) @ testing-mysql-server ---
[INFO] Checking dependency versions
[INFO]
[INFO] --- license-maven-plugin:2.3:check (default) @ testing-mysql-server ---
[INFO] Checking licenses...
[INFO]
[INFO] --- jacoco-maven-plugin:0.6.2.201302030002:prepare-agent (default) @ testing-mysql-server ---
[INFO] argLine set to -javaagent:/root/.m2/repository/org/jacoco/org.jacoco.agent/0.6.2.201302030002/org.jacoco.agent-0.6.2.201302030002-runtime.jar=destfile=/root/testing-mysql-server/target/jacoco.exec
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ testing-mysql-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /root/testing-mysql-server/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ testing-mysql-server ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /root/testing-mysql-server/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ testing-mysql-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /root/testing-mysql-server/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ testing-mysql-server ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /root/testing-mysql-server/target/test-classes
[INFO]
[INFO] --- maven-dependency-plugin:2.8:analyze-only (default) @ testing-mysql-server ---
[INFO] No dependency problems found
[INFO]
[INFO] --- maven-dependency-plugin:2.8:analyze-duplicate (default) @ testing-mysql-server ---
[INFO] No duplicate dependencies found in or in
[INFO]
[INFO] --- maven-dependency-plugin:2.8:analyze-dep-mgt (default) @ testing-mysql-server ---
[INFO] Found Resolved Dependency / DependencyManagement mismatches:
[INFO] Ignoring Direct Dependencies.
[INFO] None
[INFO]
[INFO] --- maven-duplicate-finder-plugin:1.0.6:check (default) @ testing-mysql-server ---
[INFO] Checking compile classpath
[INFO] Checking runtime classpath
[INFO] Checking test classpath
[INFO]
[INFO] --- maven-surefire-plugin:2.14:test (default-test) @ testing-mysql-server ---
[INFO] Surefire report directory: /root/testing-mysql-server/target/surefire-reports
Running io.airlift.testing.mysql.TestTestingMySqlServer
Configuring TestNG with: TestNG652Configurator
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.797 sec <<< FAILURE!
testDatabase(io.airlift.testing.mysql.TestTestingMySqlServer) Time elapsed: 0.43 sec <<< FAILURE!
java.util.MissingResourceException: Resource '5-5-9/Linux-ppc64le/mysqld' not found
at com.mysql.management.util.Streams.getResourceAsStream(Streams.java:124)
at com.mysql.management.util.Streams.getResourceAsStream(Streams.java:108)
at com.mysql.management.util.Streams$1.inner(Streams.java:140)
at com.mysql.management.util.Exceptions$VoidBlock.exec(Exceptions.java:129)
at com.mysql.management.util.Streams.createFileFromResource(Streams.java:153)
at com.mysql.management.MysqldResource.extractExecutable(MysqldResource.java:544)
at com.mysql.management.MysqldResource.makeMysqld(MysqldResource.java:532)
at com.mysql.management.MysqldResource.deployFiles(MysqldResource.java:515)
at com.mysql.management.MysqldResource.exec(MysqldResource.java:492)
at com.mysql.management.MysqldResource.start(MysqldResource.java:213)
at com.mysql.management.MysqldResource.start(MysqldResource.java:168)
at io.airlift.testing.mysql.TestingMySqlServer.(TestingMySqlServer.java:78)
at io.airlift.testing.mysql.TestingMySqlServer.(TestingMySqlServer.java:56)
at io.airlift.testing.mysql.TestTestingMySqlServer.testDatabase(TestTestingMySqlServer.java:35)
Results :
Failed tests:
TestTestingMySqlServer.testDatabase:35 » MissingResource Resource '5-5-9/Linux...
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.434 s
[INFO] Finished at: 2015-12-17T19:12:50+05:30
[INFO] Final Memory: 17M/41M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.14:test (default-test) on project testing-mysql-server: There are test failures.
[ERROR]
[ERROR] Please refer to /root/testing-mysql-server/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Version 8.0.12-1
has an implicit dependency on libssl.so.1.0.0
and libcrypto.so.1.0.0
being present in the user's environment.
While the packaging script adds these, it only adds them to the lib
folder. The standard MySQL distribution has these files present in both the bin
and lib
folders. It appears that due to the way the binary is linked, it's not sufficient for these to be present in just the lib
folder.
This can be verified by running the following in a Linux distribution.
jar xf testing-mysql-server-8.0.12-1.jar
tar xvzf mysql-Linux-amd64.tar.gz
cd bin
ldd mysqld
Output:
[tdm@mymachine ~/mydir] ldd mysqld
<<SNIP>>
libssl.so.1.0.0 => not found
libcrypto.so.1.0.0 => not found
<<SNIP>>
If you compare this with the standard distribution of mysql, they get picked up because it picks up the local .so files in bin
:
[tdm@mymachine ~/deleteme/mysql-8.0.15-linux-glibc2.12-x86_64/bin] ldd mysqld
<<SNIP>>
libssl.so.1.0.0 => /home/tdm/deleteme/mysql-8.0.15-linux-glibc2.12-x86_64/bin/./libssl.so.1.0.0 (0x00007fd1e1652000)
libcrypto.so.1.0.0 => /home/tdm/deleteme/mysql-8.0.15-linux-glibc2.12-x86_64/bin/./libcrypto.so.1.0.0 (0x00007fd1e1218000)
<<SNIP>>
Without the .so files the server fails to start:
/tmp/testing-mysql-server6111734346362237715/bin/mysqld: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
at io.airlift.testing.mysql.EmbeddedMySql.system(EmbeddedMySql.java:280)
at io.airlift.testing.mysql.EmbeddedMySql.initialize(EmbeddedMySql.java:158)
at io.airlift.testing.mysql.EmbeddedMySql.<init>(EmbeddedMySql.java:80)
at io.airlift.testing.mysql.TestingMySqlServer.<init>(TestingMySqlServer.java:54)
at io.airlift.testing.mysql.TestingMySqlServer.<init>(TestingMySqlServer.java:44)
java.lang.RuntimeException: java.lang.NullPointerException
at com.mysql.management.MysqldResource.destroyShell(MysqldResource.java:359)
at com.mysql.management.MysqldResource.shutdown(MysqldResource.java:323)
at io.airlift.testing.mysql.TestingMySqlServer.close(TestingMySqlServer.java:136)
at io.airlift.testing.Closeables.closeAllRuntimeException(Closeables.java:76)
at com.facebook.presto.raptor.TestRaptorIntegrationSmokeTestMySql.destroy(TestRaptorIntegrationSmokeTestMySql.java:54)
Tests for packages fail as mysql deamon fails to start.
On ppce RHEL architecture, on building the package a tmp folder is formed under /tmp. the daemon fails to start with the command below, run as part of testcases
[/tmp/testing-mysql-server6374051306685796804/bin/mysqld][--no-defaults][--basedir=/tmp/testing-mysql-server6374051306685796804][--socket=mysql.sock][--port=59281][--datadir=/tmp/testing-mysql-server6374051306685796804/data][--pid-file=/tmp/testing-mysql-server6374051306685796804/data/MysqldResource.pid]
[MysqldResource] launching mysqld (testing-mysql-server)
2016-05-26 10:18:30 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-05-26 10:18:30 0 [Note] /tmp/testing-mysql-server6374051306685796804/bin/mysqld (mysqld 5.6.30) starting as process 13567 ...
2016-05-26 10:18:30 13567 [ERROR] Can't read from messagefile '/tmp/testing-mysql-server6374051306685796804/share/english/errmsg.sys'
2016-05-26 10:18:30 13567 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2016-05-26 10:18:30 13567 [ERROR] Aborting
2016-05-26 10:18:30 13567 [Note] Binlog end
2016-05-26 10:18:30 13567 [Note]
I am able to start the server with the following command
/tmp/testing-mysql-server6374051306685796804/bin/mysql start
can anyone help on if any setting is being missed which fails to start the server as per the script
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.