Return-Path: X-Original-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0397ED3B3 for ; Tue, 30 Oct 2012 22:36:40 +0000 (UTC) Received: (qmail 37840 invoked by uid 500); 30 Oct 2012 22:36:39 -0000 Delivered-To: apmail-incubator-cloudstack-dev-archive@incubator.apache.org Received: (qmail 37809 invoked by uid 500); 30 Oct 2012 22:36:39 -0000 Mailing-List: contact cloudstack-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-dev@incubator.apache.org Received: (qmail 37800 invoked by uid 99); 30 Oct 2012 22:36:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2012 22:36:39 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [195.66.90.41] (HELO sbppmx2.schubergphilis.com) (195.66.90.41) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2012 22:36:31 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by sbppmx2.schubergphilis.com (Postfix) with ESMTP id E02CC1290D for ; Tue, 30 Oct 2012 23:36:11 +0100 (MET) X-Virus-Scanned: amavisd-new at schubergphilis.com Received: from sbppmx2.schubergphilis.com ([127.0.0.1]) by localhost (sbppmx2.schubergphilis.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hRi7UqDsNP7Y for ; Tue, 30 Oct 2012 23:36:11 +0100 (MET) Received: from SBPOTMG401.sbp.lan (edge.schubergphilis.com [195.66.90.11]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by sbppmx2.schubergphilis.com (Postfix) with ESMTP id CD6B312865 for ; Tue, 30 Oct 2012 23:36:11 +0100 (MET) Received: from SBPOMF101.sbp.lan (10.71.2.130) by SBPOTMG401.sbp.lan (10.71.3.110) with Microsoft SMTP Server (TLS) id 14.1.379.0; Tue, 30 Oct 2012 23:36:11 +0100 Received: from SBPOMB402.sbp.lan ([fe80::2410:c2c8:67bf:d067]) by SBPOMF101.sbp.lan ([fe80::253f:3a21:d553:7947%15]) with mapi id 14.02.0318.001; Tue, 30 Oct 2012 23:36:11 +0100 From: Hugo Trippaers To: "" CC: "cloudstack-dev@incubator.apache.org" Subject: Re: Unit Test Failures Thread-Topic: Unit Test Failures Thread-Index: AQHNtuGFozHtVjomrE6Xfhqjj6CFWJfSal0w///y+gCAABLRYQ== Date: Tue, 30 Oct 2012 22:36:10 +0000 Message-ID: References: <87BA338A-D258-475D-8D11-5A68C36F7EFF@basho.com> <6DE00C9FDF08A34683DF71786C70EBF02F382515@SBPOMB402.sbp.lan>,<3B667984-E4D3-48E0-AAC3-F290778174C8@basho.com> In-Reply-To: <3B667984-E4D3-48E0-AAC3-F290778174C8@basho.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org I think/hope that you mean 'should not require' :-) I think we can do something with the integration test framework in maven. I= haven't looked at it in detail yet. Ideally even that should by sort of se= lf contained by using an in memory database during the integration test fog= example.=20 For now we can put the test classes with db tests in the exclude list in th= e Pom.xml and I'll see if I can enable them with a profile. Cheers, Hugo Sent from my iPhone On 30 okt. 2012, at 23:29, "John Burwell" wrote: > Hugo, >=20 > Generally speaking, unit tests should require any outside resources -- in= cluding a database. Is there a way we can separate the tests that require = a database into an integration test suite? Such an approach would preserve= the important testing being performed by these tests to continue, and allo= w for the development of isolated unit tests. >=20 > Thanks, > -John >=20 > On Oct 30, 2012, at 6:21 PM, Hugo Trippaers wrote: >=20 >> Hey John, >>=20 >> The unit tests disabled in the maven build for a long time, because a lo= t of the unit tests do indeed require an active database. Today I disabled = most of those database tests and enabled the test procedures in maven as I = don't think every developer has an active database, but still might want to= run any unittests that don't depend on the database. The tests you mention= most have slipped through, which makes it very interesting as the test res= ult is blue (in jenkins) while obviously there is something going horribly = wrong. >>=20 >> You can still disable the tests during your maven run, but they are now = enabled by default. See http://maven.apache.org/plugins/maven-surefire-plug= in/examples/skipping-test.html >>=20 >>=20 >> Cheers, >>=20 >> Hugo >>=20 >>> -----Original Message----- >>> From: John Burwell [mailto:jburwell@basho.com] >>> Sent: Tuesday, October 30, 2012 9:59 PM >>> To: cloudstack-dev@incubator.apache.org >>> Subject: Unit Test Failures >>>=20 >>> All, >>>=20 >>> I just pulled down the latest from master, and am receiving a pile of u= nit test >>> errors such as the following: >>>=20 >>> 2012-10-30 16:56:50,951 ERROR [db.Transaction.Transaction] (Thread-587:= ) >>> Unexpected exception: >>> com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: >>> Communications link failure >>>=20 >>> The last packet sent successfully to the server was 0 milliseconds ago.= The >>> driver has not received any packets from the server. >>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native >>> Method) >>> at >>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructor >>> AccessorImpl.java:39) >>> at >>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCon >>> structorAccessorImpl.java:27) >>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513) >>> at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) >>> at >>> com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:112 >>> 2) >>> at >>> com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2260) >>> at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:787) >>> at >>> com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:49) >>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native >>> Method) >>> at >>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructor >>> AccessorImpl.java:39) >>> at >>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCon >>> structorAccessorImpl.java:27) >>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513) >>> at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) >>> at >>> com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:357) >>> at >>> com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:2= 8 >>> 5) >>> at java.sql.DriverManager.getConnection(DriverManager.java:582) >>> at java.sql.DriverManager.getConnection(DriverManager.java:185) >>> at >>> org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnec >>> tion(DriverManagerConnectionFactory.java:75) >>> at >>> org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(Poolabl >>> eConnectionFactory.java:582) >>> at >>> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericO >>> bjectPool.java:1188) >>> at >>> org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataS >>> ource.java:106) >>> at >>> com.cloud.utils.db.Transaction.getStandaloneConnectionWithException(Tra= n >>> saction.java:200) >>> at >>> com.cloud.utils.db.Transaction.getStandaloneConnection(Transaction.java= :2 >>> 09) >>> at >>> com.cloud.utils.db.DbUtil.getConnectionForGlobalLocks(DbUtil.java:58) >>> at com.cloud.utils.db.DbUtil.getGlobalLock(DbUtil.java:203) >>> at com.cloud.utils.db.GlobalLock.lock(GlobalLock.java:159) >>> at >>> com.cloud.utils.db.GlobalLockTest$Worker.run(GlobalLockTest.java:43) >>> at java.lang.Thread.run(Thread.java:680) >>> Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: >>> Communications link failure >>>=20 >>> The last packet sent successfully to the server was 0 milliseconds ago.= The >>> driver has not received any packets from the server. >>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native >>> Method) >>> at >>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructor >>> AccessorImpl.java:39) >>> ... 28 more >>> Caused by: java.net.ConnectException: Connection refused >>> at java.net.PlainSocketImpl.socketConnect(Native Method) >>> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) >>> at >>> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) >>> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) >>> at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432) >>> ... 29 more >>>=20 >>> Are the unit tests requiring an instance of MySql be up and running? >>>=20 >>> Thanks, >>> -John >=20