Projects tigase _server server-core Issues #692
Check results of TTS-NG on version 7.2.0 (#692)
Andrzej Wójcik (Tigase) opened 8 years ago
Due Date
2017-04-06

While working on refactoring of TTS-NG, I looked on results and some tests are not passing event that this test should pass.

We need to make sure that all tests that should pass are passing as a lot of changes in 7.2.0 could create issues with this tests.

Andrzej Wójcik (Tigase) commented 8 years ago

I've checked failed tests which should pass and it was caused by few issues in components ported to kernel. I fixed this components.

There are still some tests failing, most likely due to misconfiguration of my test server. I need to verify this, but I think it is not important and may be done later.

Andrzej Wójcik (Tigase) commented 8 years ago

I needed to add following settings to make most of tests pass:

unified-archive () {
    tags-support = true
}
msgRepository {
    user-store-limit-enable = true
}
http () {
    api-keys = [ 'test123' ]
}
pubsub () {
}
muc () {
}
sess-man {
    unified-message-archive-xep-0136 () { }
    message-archive () {
        msg-archive-paths = [ '-/message/result[urn:xmpp:mam:1]' '/message/body', '/message/subject' ]
    }
}

Still need to review issues with Jaxmpp tests failing with new version of Jaxmpp:

  TestHandlingOfConnectionIssues.testStateAfterAuthTimeoutBosh:62->testStateAfterAuthTimeout:105 expected [disconnected] but found [connected]
  TestHandlingOfConnectionIssues.testStateAfterAuthTimeoutSocket:67->testStateAfterAuthTimeout:105 expected [disconnected] but found [connected]
  TestHandlingOfConnectionIssues.testStateAfterAuthTimeoutWebSocket:57->testStateAfterAuthTimeout:105 expected [disconnected] but found [connected]
  TestHandlingOfConnectionIssues.testStateAfterConnectionFailureBosh:124->testStateAfterConnectionFailure:171 expected [true] but found [false]
  TestHandlingOfConnectionIssues.testStateAfterConnectionFailureSocket:129->testStateAfterConnectionFailure:169 » Jaxmpp
  TestHandlingOfConnectionIssues.testStateAfterConnectionFailureWebSocket:119->testStateAfterConnectionFailure:169 » Jaxmpp
  TestReconnections.testMultipleReconnectionsBosh:50->testMultipleReconnections:80 expected [true] but found [false]
Andrzej Wójcik (Tigase) commented 8 years ago

I found few issues related to new version of Jaxmpp and changed event propagation mechanism from synchronous to single threaded which lead to improper state of Jaxmpp instance after error or reconnection and fixed it.

Looks like most of TTS-NG tests passes and for me only tests without valid configuration like TwoWayTLS or OfflineMessagesSinkProvider are failing, so I think that we can say that 7.2.0 is stable enough to be a stable base for development of new features.

wojciech.kapcia@tigase.net commented 8 years ago

Given those are "general functionalities" I think we should make them pass as well - those would require particular configuration on server side (see "V" project for what's required) and provide this configuration as the "dist" in the tts-ng.

Andrzej Wójcik (Tigase) commented 8 years ago

I checked this 2 last tests and they work fine.

I prepared example init.properties file as etc/init.properties.dist@. However I've seen there is other @init.properties file in resources, but in may opinion it will now work.

wojciech.kapcia@tigase.net commented 8 years ago

I've tried to run the TTS against 7.2.0 with the provided init.properties.dist and there were/are a couple of issues:

  • mentioned file uses hardcoded names specific to your machine thus it's not a "drop-in" replacement to run a test - while the JID may be bound to particular VHost, using default publisher should be possible (dependent on the particular machine hostname, also there was a typeo in property name: msg_pubsub-publisher ):
amp () {
    msg-pubsub-jid = 'pubsub.zeus'
    msg-pubsub-node = 'test'
    msg_pubsub-publisher = 'sess-man@mbp-andrzej.local'
}
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 91.356 sec <<< FAILURE! - in tigase.tests.server.offlinemsg.TestOfflineMessageSinkProvider
testOfflineMessageSinkProvider(tigase.tests.server.offlinemsg.TestOfflineMessageSinkProvider)  Time elapsed: 90.825 sec  <<< FAILURE!
java.lang.AssertionError: Notification from PubSub not received! expected [true] but found [false]
	at org.testng.Assert.fail(Assert.java:94)
	at org.testng.Assert.failNotEquals(Assert.java:494)
	at org.testng.Assert.assertTrue(Assert.java:42)
	at tigase.tests.server.offlinemsg.TestOfflineMessageSinkProvider.testOfflineMessageSinkProvider(TestOfflineMessageSinkProvider.java:149)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
  • there seems to be problem with handling aliases ( %bmalkow ):

    • log:
2017-02-08 12:01:34.926 [main]             AbstractBeanConfigurator.configure()  WARNING: Field 'msg-pubsub-jid' does not exists in bean 'amp'. Ignoring!
2017-02-08 12:01:34.927 [main]             AbstractBeanConfigurator.configure()  WARNING: Field 'msg-pubsub-node' does not exists in bean 'amp'. Ignoring!
2017-02-08 12:01:34.927 [main]             AbstractBeanConfigurator.configure()  WARNING: Field 'msg-pubsub-publisher' does not exists in bean 'amp'. Ignoring!
  • AMP code:
	private static final String MSG_PUBSUB_JID = "msg-pubsub-jid";
	private static final String MSG_PUBSUB_NODE = "msg-pubsub-node";
	private static final String MSG_PUBSUB_PUBLISHER = "msg-pubsub-publisher";
…
		@ConfigField(desc = "PubSub component JID", alias = MSG_PUBSUB_JID)
		private String pubSubJID;
		@ConfigField(desc = "PubSub node for offline messages", alias = MSG_PUBSUB_NODE)
		private String pubSubNode;
		@ConfigField(desc = "PubSub offline message publisher", alias = MSG_PUBSUB_PUBLISHER)
		private String defaultPublisher;
  • in the end here's the result of the whole TTS run (report is attached):
Failed tests:
  TestMessageArchiveManagement.testRetrievalOfForm:120
  TestMessageArchiveManagement.testSettingsChange:150
  TestMessageArchivingBasic.testChangeArchiveSettings:94 Setting settings failed - shoule pass. expected [true] but found [false]
  TestMessageArchivingMUC.testArchivingOfMucMessages:105->enableArchiving:265 Could not properly set message archiving settings expected [true] but found [false]
  TestMessageArchivingRSM.testCreationAndRetrievalOfLastMsgs:121 expected [0] but found [10]
tigase.tests.archive.TestMessageArchivingTagsAndContains.setUpTest(tigase.tests.archive.TestMessageArchivingTagsAndContains)
  Run 1: TestMessageArchivingTagsAndContains.setUpTest:70 Set archive for user error. expected [true] but found [false]
  Run 2: PASS
  Run 3: PASS

  TestAdminUI.testGetUserInfoUserOffline:342 » IndexOutOfBounds Index: 0, Size: ...
  TestAdminUI.testModifyUser:258 expected [false] but found [true]
  TestModificationOfPrivacyRulesUsingREST.testMessageFiltering:204->AbstractTest.sendAndFail:697 Message wasn't blocked
  TestRetrievalOfUserAvatarUsingREST.testUserAvatarSupportXEP0084:286->publishAvatar:129 Data item not published properly
  TestMessageArchiveManagement.test_MAM_retrieveBetween:130->assertRetrievedMessages:246 expected:<15> but was:<16>
  TestPubSubMAM.testRetrieveWithTimestampsLimitAndAfterFromCollection:141->testRetrieveWithTimestampsLimitAndAfterFrom:190->queryNode:259 expected:<10> but was:<0>
  TestPubSubMAM.testRetrieveWithTimestampsLimitAndAfterFromLeaf:146->testRetrieveWithTimestampsLimitAndAfterFrom:190->queryNode:259 expected:<10> but was:<0>
  TestPubSubMAM.testRetrieveWithTimestampsLimitAndAfterFromRoom:136->testRetrieveWithTimestampsLimitAndAfterFrom:190->queryNode:259 expected:<10> but was:<0>
  TestRemovalOfPepNodeOnUserRemoval.testRemovalOfPepServiceNodesOnUserRemoval:172 expected [true] but found [false]
  TestRestApiWithMessageExpiration.testMessageExpiration:231->publishToPubsub:379 Publishing was successful expected [true] but found [false]
  TestServerMonitoring.testTigaseXMPPServerMonitoring:150->disableTaskConfig:71 SampleTask can't be disabled! expected [true] but found [false]
  TestTwoWayTLS.testConnectionWithCertificate:112 expected object to not be null
  TestOfflineMessageSinkProvider.testOfflineMessageSinkProvider:149 Notification from PubSub not received! expected [true] but found [false]
  RetrieveVersion.retrieveServerVersion:60->retrieveVersion:70 contact was not connected expected [true] but found [false]



Tests run: 133, Failures: 20, Errors: 0, Skipped: 15
Andrzej Wójcik (Tigase) commented 8 years ago

Wojciech Kapcia wrote:

I've tried to run the TTS against 7.2.0 with the provided init.properties.dist and there were/are a couple of issues:

  • mentioned file uses hardcoded names specific to your machine thus it's not a "drop-in" replacement to run a test - while the JID may be bound to particular VHost, using default publisher should be possible (dependent on the particular machine hostname, also there was a typeo in property name: msg_pubsub-publisher ):

[...] However after adjusting it it still fails:

[...]

I've fixed most of the issues. I think that only 1 is left with SASL SCRAM mechanism ignoring state of account - so even user with disabled account can log in as it uses TigGetPassword instead of @TigUserLoginPlainPw@.

  • there seems to be problem with handling aliases ( %bmalkow ):

** log:

[...]

** AMP code:

[...]

No, this is correct. Fields are in separate class not in MessageAmp but in bean being loaded as amp subbean. Due to that configurator warns you that MessageAmp do not have this config fields but other subbean reads this values by accessing configuration of a parent beans.

  • in the end here's the result of the whole TTS run (report is attached):

[...]

As I mentioned, most of them is working now. In most cases issues were caused by changes in configuration and addition of new features which were not enabled in example config file which I provided.

It would be best to check after next snapshot build will be generated to make sure that all my changes are include in a build.

wojciech.kapcia@tigase.net commented 8 years ago

I run the tests against latest nightly and they still seem to fail (with the clean DB, just created):

Failed tests:
  ExampleJaxmppTest.SimpleLoginTest:50->AbstractTest.createUserAccount:334->AbstractTest.createUserAccount:339->AbstractTest.createUserAccount:344->AbstractTest.createUserAccount:349->AbstractTest.createUserAccount:415 Registration failed!
  TestMessageArchiveManagement.testMessageRetrievalWithNonEmptyResultsWithQuery:197->testMessageRerieval:253->testMessageRerieval:305 expected:<16> but was:<17>
  TestMessageArchivingMUC.prepareTest:77->AbstractTest.createUserAccount:334->AbstractTest.createUserAccount:339->AbstractTest.createUserAccount:344->AbstractTest.createUserAccount:349->AbstractTest.createUserAccount:415 Registration failed!
  TestAdminUI.testModifyUser:260 expected [false] but found [true]
tigase.tests.jaxmpp.TestHandlingOfConnectionIssues.setUp(tigase.tests.jaxmpp.TestHandlingOfConnectionIssues)
  Run 1: TestHandlingOfConnectionIssues.setUp:51->AbstractTest.createUserAccount:334->AbstractTest.createUserAccount:339->AbstractTest.createUserAccount:344->AbstractTest.createUserAccount:349->AbstractTest.createUserAccount:415 Registration failed!
  Run 2: PASS
  Run 3: PASS
  Run 4: PASS
  Run 5: PASS
  Run 6: PASS

  TestReconnections.testMultipleReconnectionsBosh:50->testMultipleReconnections:61->AbstractTest.createUserAccount:334->AbstractTest.createUserAccount:339->AbstractTest.createUserAccount:344->AbstractTest.createUserAccount:349->AbstractTest.createUserAccount:415 Registration failed!
  TestReconnections.testMultipleReconnectionsSocket:56->testMultipleReconnections:61->AbstractTest.createUserAccount:334->AbstractTest.createUserAccount:339->AbstractTest.createUserAccount:344->AbstractTest.createUserAccount:349->AbstractTest.createUserAccount:415 Registration failed!
  TestReconnections.testMultipleReconnectionsWebSocket:44->testMultipleReconnections:61->AbstractTest.createUserAccount:334->AbstractTest.createUserAccount:339->AbstractTest.createUserAccount:344->AbstractTest.createUserAccount:349->AbstractTest.createUserAccount:415 Registration failed!
  TestMessageArchiveManagement.test_MAM_retrieveBetween:130->assertRetrievedMessages:246 expected:<15> but was:<16>
  TestPubSubMAM.testRetrieveWithTimestampsLimitAndAfterFromCollection:141->testRetrieveWithTimestampsLimitAndAfterFrom:190->queryNode:259 expected:<10> but was:<0>
  TestPubSubMAM.testRetrieveWithTimestampsLimitAndAfterFromLeaf:146->testRetrieveWithTimestampsLimitAndAfterFrom:190->queryNode:259 expected:<10> but was:<0>
  TestPubSubMAM.testRetrieveWithTimestampsLimitAndAfterFromRoom:136->testRetrieveWithTimestampsLimitAndAfterFrom:190->queryNode:259 expected:<10> but was:<0>
  TestRestApiWithMessageExpiration.testMessageExpiration:231->publishToPubsub:379 Publishing was successful expected [true] but found [false]
  TestServerMonitoring.testTigaseXMPPServerMonitoring:150->disableTaskConfig:71 SampleTask can't be disabled! expected [true] but found [false]
  TestTwoWayTLS.testConnectionWithCertificate:112 expected object to not be null
  TestOfflineMessageSinkProvider.testOfflineMessageSinkProvider:149 Notification from PubSub not received! expected [true] but found [false]

Most of the time it looks like off by 1 error (looking at the sizes).

Also, at one point Tigase started with the DB exceptions (most likely concurrency problems) most likely adding to failing tests:

2017-03-08 19:26:16.020 [in_6-message-archive]  JDBCMessageArchiveRepository.archiveMessage()  WARNING: Problem adding new entry to DB: <message to="user1_ih6eaf0327@localhost/1305655632-tigase-97" from="user1_ih6eaf0327@localhost/1305655632-tigase-97" type="chat" xmlns="jabber:client" id="9pbya80389" time="1489011976019"><body>5tm0fl0388 #Badaveag0387</body></message>
java.sql.BatchUpdateException: Column 'owner_id' cannot be null
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.Util.getInstance(Util.java:408)
	at com.mysql.jdbc.SQLError.createBatchUpdateException(SQLError.java:1162)
	at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1773)
	at com.mysql.jdbc.PreparedStatement.executeBatchInternal(PreparedStatement.java:1257)
	at com.mysql.jdbc.StatementImpl.executeLargeBatch(StatementImpl.java:2587)
	at com.mysql.jdbc.CallableStatement.executeLargeBatch(CallableStatement.java:2420)
	at com.mysql.jdbc.CallableStatement.executeBatch(CallableStatement.java:2214)
	at tigase.archive.db.JDBCMessageArchiveRepository.archiveMessage(JDBCMessageArchiveRepository.java:228)
	at tigase.archive.db.JDBCMessageArchiveRepository.archiveMessage(JDBCMessageArchiveRepository.java:158)
	at tigase.archive.db.MessageArchiveRepositoryPool.archiveMessage(MessageArchiveRepositoryPool.java:75)
	at tigase.archive.modules.ArchivingModule.process(ArchivingModule.java:102)
	at tigase.component.modules.StanzaProcessor.process(StanzaProcessor.java:56)
	at tigase.component.modules.StanzaProcessor.processPacket(StanzaProcessor.java:77)
	at tigase.component.AbstractKernelBasedComponent.processPacket(AbstractKernelBasedComponent.java:102)
	at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1513)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'owner_id' cannot be null
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.Util.getInstance(Util.java:408)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
	at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073)
	at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1751)
	at com.mysql.jdbc.PreparedStatement.executeBatchInternal(PreparedStatement.java:1257)
	at com.mysql.jdbc.StatementImpl.executeLargeBatch(StatementImpl.java:2587)
	at com.mysql.jdbc.CallableStatement.executeLargeBatch(CallableStatement.java:2420)
	at com.mysql.jdbc.CallableStatement.executeBatch(CallableStatement.java:2214)
	at tigase.archive.db.JDBCMessageArchiveRepository.archiveMessage(JDBCMessageArchiveRepository.java:228)
	at tigase.archive.db.JDBCMessageArchiveRepository.archiveMessage(JDBCMessageArchiveRepository.java:158)
	at tigase.archive.db.MessageArchiveRepositoryPool.archiveMessage(MessageArchiveRepositoryPool.java:75)
	at tigase.archive.modules.ArchivingModule.process(ArchivingModule.java:102)
	at tigase.component.modules.StanzaProcessor.process(StanzaProcessor.java:56)
	at tigase.component.modules.StanzaProcessor.processPacket(StanzaProcessor.java:77)
	at tigase.component.AbstractKernelBasedComponent.processPacket(AbstractKernelBasedComponent.java:102)
	at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1513)
2017-03-08 19:27:09.318 [jabber:iq:register Queue Worker 7]  RepositoryAccess.register()  SEVERE: Repository access exception.
tigase.db.TigaseDBException: Problem accessing repository for user: muc_test_efz5kn0390@localhost
	at tigase.db.jdbc.TigaseCustomAuth.addUser(TigaseCustomAuth.java:355)
	at tigase.db.AuthRepositoryMDImpl.addUser(AuthRepositoryMDImpl.java:67)
	at tigase.xmpp.RepositoryAccess.register(RepositoryAccess.java:473)
	at tigase.xmpp.impl.JabberIqRegister.process(JabberIqRegister.java:357)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2437)
	at tigase.util.WorkerThread.run(WorkerThread.java:128)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.Util.getInstance(Util.java:408)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:951)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192)
	at com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:823)
	at tigase.db.jdbc.TigaseCustomAuth.addUser(TigaseCustomAuth.java:336)
	at tigase.db.AuthRepositoryMDImpl.addUser(AuthRepositoryMDImpl.java:67)
	at tigase.xmpp.RepositoryAccess.register(RepositoryAccess.java:473)
	at tigase.xmpp.impl.JabberIqRegister.process(JabberIqRegister.java:357)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2437)
	at tigase.util.WorkerThread.run(WorkerThread.java:128)
2017-03-08 19:28:00.492 [jabber:iq:register Queue Worker 1]  RepositoryAccess.register()  SEVERE: Repository access exception.
tigase.db.TigaseDBException: Problem accessing repository for user: test_user_yj51fl0391@localhost
	at tigase.db.jdbc.TigaseCustomAuth.addUser(TigaseCustomAuth.java:355)
	at tigase.db.AuthRepositoryMDImpl.addUser(AuthRepositoryMDImpl.java:67)
	at tigase.xmpp.RepositoryAccess.register(RepositoryAccess.java:473)
	at tigase.xmpp.impl.JabberIqRegister.process(JabberIqRegister.java:357)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2437)
	at tigase.util.WorkerThread.run(WorkerThread.java:128)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.Util.getInstance(Util.java:408)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:951)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192)
	at com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:823)
	at tigase.db.jdbc.TigaseCustomAuth.addUser(TigaseCustomAuth.java:336)
	at tigase.db.AuthRepositoryMDImpl.addUser(AuthRepositoryMDImpl.java:67)
	at tigase.xmpp.RepositoryAccess.register(RepositoryAccess.java:473)
	at tigase.xmpp.impl.JabberIqRegister.process(JabberIqRegister.java:357)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2437)
	at tigase.util.WorkerThread.run(WorkerThread.java:128)
2017-03-08 19:28:51.693 [jabber:iq:register Queue Worker 5]  RepositoryAccess.register()  SEVERE: Repository access exception.
tigase.db.TigaseDBException: Problem accessing repository for user: jaxmpp__xr8ir80392@localhost
	at tigase.db.jdbc.TigaseCustomAuth.addUser(TigaseCustomAuth.java:355)
	at tigase.db.AuthRepositoryMDImpl.addUser(AuthRepositoryMDImpl.java:67)
	at tigase.xmpp.RepositoryAccess.register(RepositoryAccess.java:473)
	at tigase.xmpp.impl.JabberIqRegister.process(JabberIqRegister.java:357)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2437)
	at tigase.util.WorkerThread.run(WorkerThread.java:128)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.Util.getInstance(Util.java:408)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:951)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192)
	at com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:823)
	at tigase.db.jdbc.TigaseCustomAuth.addUser(TigaseCustomAuth.java:336)
	at tigase.db.AuthRepositoryMDImpl.addUser(AuthRepositoryMDImpl.java:67)
	at tigase.xmpp.RepositoryAccess.register(RepositoryAccess.java:473)
	at tigase.xmpp.impl.JabberIqRegister.process(JabberIqRegister.java:357)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2437)
	at tigase.util.WorkerThread.run(WorkerThread.java:128)
2017-03-08 19:29:42.850 [jabber:iq:register Queue Worker 6]  RepositoryAccess.register()  SEVERE: Repository access exception.
tigase.db.TigaseDBException: Problem accessing repository for user: jaxmpp__qjo4fl0393@localhost
	at tigase.db.jdbc.TigaseCustomAuth.addUser(TigaseCustomAuth.java:355)
	at tigase.db.AuthRepositoryMDImpl.addUser(AuthRepositoryMDImpl.java:67)
	at tigase.xmpp.RepositoryAccess.register(RepositoryAccess.java:473)
	at tigase.xmpp.impl.JabberIqRegister.process(JabberIqRegister.java:357)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2437)
	at tigase.util.WorkerThread.run(WorkerThread.java:128)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.Util.getInstance(Util.java:408)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:951)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192)
	at com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:823)
	at tigase.db.jdbc.TigaseCustomAuth.addUser(TigaseCustomAuth.java:336)
	at tigase.db.AuthRepositoryMDImpl.addUser(AuthRepositoryMDImpl.java:67)
	at tigase.xmpp.RepositoryAccess.register(RepositoryAccess.java:473)
	at tigase.xmpp.impl.JabberIqRegister.process(JabberIqRegister.java:357)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2437)
	at tigase.util.WorkerThread.run(WorkerThread.java:128)
2017-03-08 19:30:33.028 [jabber:iq:register Queue Worker 7]  RepositoryAccess.register()  SEVERE: Repository access exception.
tigase.db.TigaseDBException: Problem accessing repository for user: jaxmpp__24b0vr0394@localhost
	at tigase.db.jdbc.TigaseCustomAuth.addUser(TigaseCustomAuth.java:355)
	at tigase.db.AuthRepositoryMDImpl.addUser(AuthRepositoryMDImpl.java:67)
	at tigase.xmpp.RepositoryAccess.register(RepositoryAccess.java:473)
	at tigase.xmpp.impl.JabberIqRegister.process(JabberIqRegister.java:357)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2437)
	at tigase.util.WorkerThread.run(WorkerThread.java:128)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.Util.getInstance(Util.java:408)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:951)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192)
	at com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:823)
	at tigase.db.jdbc.TigaseCustomAuth.addUser(TigaseCustomAuth.java:336)
	at tigase.db.AuthRepositoryMDImpl.addUser(AuthRepositoryMDImpl.java:67)
	at tigase.xmpp.RepositoryAccess.register(RepositoryAccess.java:473)
	at tigase.xmpp.impl.JabberIqRegister.process(JabberIqRegister.java:357)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2437)
	at tigase.util.WorkerThread.run(WorkerThread.java:128)
2017-03-08 19:31:24.225 [jabber:iq:register Queue Worker 1]  RepositoryAccess.register()  SEVERE: Repository access exception.
tigase.db.TigaseDBException: Problem accessing repository for user: jaxmpp__6ni1fk0395@localhost
	at tigase.db.jdbc.TigaseCustomAuth.addUser(TigaseCustomAuth.java:355)
	at tigase.db.AuthRepositoryMDImpl.addUser(AuthRepositoryMDImpl.java:67)
	at tigase.xmpp.RepositoryAccess.register(RepositoryAccess.java:473)
	at tigase.xmpp.impl.JabberIqRegister.process(JabberIqRegister.java:357)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2437)
	at tigase.util.WorkerThread.run(WorkerThread.java:128)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.Util.getInstance(Util.java:408)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:951)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192)
	at com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:823)
	at tigase.db.jdbc.TigaseCustomAuth.addUser(TigaseCustomAuth.java:336)
	at tigase.db.AuthRepositoryMDImpl.addUser(AuthRepositoryMDImpl.java:67)
	at tigase.xmpp.RepositoryAccess.register(RepositoryAccess.java:473)
	at tigase.xmpp.impl.JabberIqRegister.process(JabberIqRegister.java:357)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2437)
	at tigase.util.WorkerThread.run(WorkerThread.java:128)
Andrzej Wójcik (Tigase) commented 8 years ago

%wojtek I've just executed same TTS-NG on a clean database (using older version of MySQL 5.5) and I got following results:

  TestMessageArchiveManagement.testMessageRetrievalWithNonEmptyResultsWithQuery:197->testMessageRerieval:253->testMessageRerieval:305 expected:<16> but was:<17>
  TestMessageArchivingMUC.testArchivingOfMucMessages:146->assertArchivedMessages:323 null: lists don't have the same size expected [2] but found [3]
  TestMessageArchivingRSM.testCreationAndRetrievalOfLastMsgs:123 Lists differ at element [0]: Test message 2 - 13 != Test message 2 - 15 expected [Test message 2 - 13] but found [Test message 2 - 15]
  TestAdminUI.testModifyUser:260 expected [false] but found [true]
  TestMessageArchiveManagement.test_MAM_retrieveAll:115->assertRetrievedMessages:246 expected:<20> but was:<0>
  TestPubSubMAM.testRetrieveWithTimestampsLimitAndAfterFromCollection:141->testRetrieveWithTimestampsLimitAndAfterFrom:190->queryNode:259 expected:<10> but was:<0>
  TestPubSubMAM.testRetrieveWithTimestampsLimitAndAfterFromLeaf:146->testRetrieveWithTimestampsLimitAndAfterFrom:190->queryNode:259 expected:<10> but was:<0>
  TestPubSubMAM.testRetrieveWithTimestampsLimitAndAfterFromRoom:136->testRetrieveWithTimestampsLimitAndAfterFrom:190->queryNode:259 expected:<10> but was:<0>
  TestRemovalOfPepNodeOnUserRemoval.testRemovalOfPepServiceNodesOnUserRemoval:244 expected [true] but found [false]
  TestRestApiWithMessageExpiration.testMessageExpiration:231->publishToPubsub:379 Publishing was successful expected [true] but found [false]
  TestServerMonitoring.testTigaseXMPPServerMonitoring:150->disableTaskConfig:71 SampleTask can't be disabled! expected [true] but found [false]
  TestTwoWayTLS.testConnectionWithCertificate:112 expected object to not be null
  TestVCard4.testVCard4SupportXEP0292:157 VCard4 retrieval by owner failed
  TestVCard4AndTempIntrgration.testVCard4ToVCardTempConversion:157 VCard4 retrieval by owner failed
  TestVCard4AndTempIntrgration.testVCardTempToVCard4Conversion:349 VCardTemp retrieval by owner failed
  TestOfflineMessageSinkProvider.testOfflineMessageSinkProvider:149 Notification from PubSub not received! expected [true] but found [false]

Some of them may be related to usage of timestamp instead of timestamp(6) but I see a lot of possible of-by-1 issues but I've never seen SQL exceptions related to locks on DB level.

I've also found that some errors are reported as Tigase uses utf8 while utf8mb4 is required for some test to pass (I wonder how this tests passed on 7.1.0?)

I will check every single issue reported in this list and try to fix it, or if issue is bigger I will create separate task for that.

wojciech.kapcia@tigase.net commented 8 years ago

Andrzej Wójcik wrote:

wojtek I've just executed same TTS-NG on a clean database (using older version of MySQL 5.5) and I got following results:

[...]

Some of them may be related to usage of timestamp instead of timestamp(6) but I see a lot of possible of-by-1 issues but I've never seen SQL exceptions related to locks on DB level.

I was executing it with Server version: 10.1.21-MariaDB Homebrew and detailed timestamp so this shouldn't be an issue.

The locks happened after 2-3 runs. If I reproduce them in the future I'll report it.

I've also found that some errors are reported as Tigase uses utf8 while utf8mb4 is required for some test to pass (I wonder how this tests passed on 7.1.0?)

Which tests? There were a couple of tests but I think they were testing BMP symbols only so should fit into basic utf8 supported by MySQL.

Andrzej Wójcik (Tigase) commented 8 years ago

Most of issues was caused by lack of precision in MySQL database schema - timestamp was used instead of @timestamp(6)@. While I was running TTS-NG before I was using PostgreSQL as a database which has better precision related to stored timestamps. As MUC is already using @timestamp(6)@, I updated other schemas to use timestamps with higher precision as well.

Additionally I've found few issues in tests (as code in server is more strict now in some cases)

Here is a list of issues and tests which were failing because of each issue:

  • Schema for Tigase fails on MySQL 5.7 - not possible to set default 0 for timestamp:
	-- Time of the last user login
	last_login timestamp NULL DEFAULT NULL,
	-- Time of the last user logout
	last_logout timestamp NULL DEFAULT NULL,
  • Issue with query in MySQL 5.7 (DO THE SAME FOR UA!)

    • TestMessageArchivingBasic.testMesssageRetrivalJidComparison:128 Retrieving message from repository failed - dcixvs0129 expected [true] but found [false]

    • TestMessageArchivingBasic.testMesssageRetrivalSuccess:117 Retrieving message from repository failed - dcixvs0129 expected [true] but found [false]

    • TestMessageArchivingTagsAndContains.testQueryWithContains:152 Retrieval of list of collections failed expected [true] but found [false]

    • TestMessageArchivingTagsAndContains.testStorageAndQueryWithTags:111 Retrieval of list of collections failed expected [true] but found [false]

  • Issue with schema and timestamp precision (6) was required

    • TestPubSubMAM.testRetrieveWithTimestampsLimitAndAfterFromCollection:141->testRetrieveWithTimestampsLimitAndAfterFrom:190->queryNode:259 expected:<10> but was:<0>

    • TestPubSubMAM.testRetrieveWithTimestampsLimitAndAfterFromLeaf:146->testRetrieveWithTimestampsLimitAndAfterFrom:190->queryNode:259 expected:<10> but was:<0>

    • TestPubSubMAM.testRetrieveWithTimestampsLimitAndAfterFromRoom:136->testRetrieveWithTimestampsLimitAndAfterFrom:190->queryNode:259 expected:<10> but was:<0>

  • Fixed issue with event not being fired

    • TestRemovalOfPepNodeOnUserRemoval.testRemovalOfPepServiceNodesOnUserRemoval:244 expected [true] but found [false]
  • Missing &useUnicode=true&characterEncoding=UTF-8 in JDBC uri

    • TestVCard4.testVCard4SupportXEP0292:157 VCard4 retrieval by owner failed

    • TestVCard4AndTempIntrgration.testVCard4ToVCardTempConversion:157 VCard4 retrieval by owner failed

    • TestVCard4AndTempIntrgration.testVCardTempToVCard4Conversion:349 VCardTemp retrieval by owner failed

  • Fixed deadlock in MsgRepository related to processing expired messages

    • TestRestApiWithMessageExpiration.testMessageExpiration:231->publishToPubsub:379 Publishing was successful expected [true] but found [false]
  • Fixed issue with access to SSLContextContainer

    • TestTwoWayTLS.testConnectionWithCertificate:112 expected object to not be null

We should consider to improve TTS-NG so it would automatically register admin accounts so automatic tests will be better as while I was running tests on empty DB I forgot to create admin user.

I think we should also automatically create PubSub node and subscribe admin to it for TestOfflineMessageSinkProvider

We are now left with following errors:

  • SCRAM-SHA1 is not checking if user is active or not!

    • TestAdminUI.testModifyUser:260 expected [false] but found [true]

This needs to be fixed in server source code as SCRAM retrieves password without checking if account is disabled or not.

  • Test of server monitoring left with "Mail with notification not received expected [true] but found [false]" but task was disabled

    • TestServerMonitoring.testTigaseXMPPServerMonitoring:150->disableTaskConfig:71 SampleTask can't be disabled! expected [true] but found [false]

If I'm correct it is now required to have a running mail server for this test to pass - not a good idea for automatic tests.

wojciech.kapcia@tigase.net commented 8 years ago

Andrzej Wójcik wrote:

Most of issues was caused by lack of precision in MySQL database schema - timestamp was used instead of @timestamp(6)@. While I was running TTS-NG before I was using PostgreSQL as a database which has better precision related to stored timestamps. As MUC is already using @timestamp(6)@, I updated other schemas to use timestamps with higher precision as well.

We need to bring back TTS nightlies in jenkins pronto, and probably finally configure TTS-NG as well, but for that we need sane defaults that we can quickly copy and provide configuration to the server.

Here is a list of issues and tests which were failing because of each issue:

  • Schema for Tigase fails on MySQL 5.7 - not possible to set default 0 for timestamp:

Thanks, there was a related issue reported with this!

With the:

componentInfo{Title=Tigase XMPP Server, Version=7.2.0-SNAPSHOT-b4709/feab3cde (2017-03-15/00:08:18), Class=tigase.server.XMPPServer}

I still see following tests falling:

  • TestMessageArchiveManagement.testMessageRetrievalWithNonEmptyResultsWithQuery:197->testMessageRerieval:253->testMessageRerieval:305 expected:<16> but was:<17> -- when run with $ mvn test ~~Dtest=tigase.tests.archive.TestMessageArchiveManagement$testMessageRetrievalWithNonEmptyResultsWithQuery (btw. there are two equally named test ~~ the other being for MUC and it's difficult to know which one failed from the report)

  • TestMessageArchivingMUC.testArchivingOfMucMessages:146->assertArchivedMessages:323 null: lists don't have the same size expected [2] but found [3]

  • TestMessageArchiveManagement.testMessageRetrievalWithNonEmptyResultsWithQuery:197->testMessageRerieval:253->testMessageRerieval:305 expected:<16> but was:<17>

We should consider to improve TTS-NG so it would automatically register admin accounts so automatic tests will be better as while I was running tests on empty DB I forgot to create admin user.

Can be a good idea, especially for other domains (e.g. test of two-way TLS)

I think we should also automatically create PubSub node and subscribe admin to it for TestOfflineMessageSinkProvider

Looking at the code - there was a code doing that but it's commented out?

We are now left with following errors:

  • SCRAM-SHA1 is not checking if user is active or not!

** TestAdminUI.testModifyUser:260 expected [false] but found [true]

This needs to be fixed in server source code as SCRAM retrieves password without checking if account is disabled or not.

That's another problem (vide: #5076) - I've created: #5084

  • Test of server monitoring left with "Mail with notification not received expected [true] but found [false]" but task was disabled

** TestServerMonitoring.testTigaseXMPPServerMonitoring:150->disableTaskConfig:71 SampleTask can't be disabled! expected [true] but found [false]

If I'm correct it is now required to have a running mail server for this test to pass - not a good idea for automatic tests.

Why this task can't be disabled?

When running the tests I've encoutered a couple of more problems:

  • #5085: Too many beans implemented class class tigase.monitor.MonitorComponent

  • #5086: NPE in MonitorComponent at addTimerTask

  • lot's of log entries in tigase-console.log (changing of log level will fix it):

2017-03-15 17:49:48.324 [in_13-message-archive]  JDBCMessageArchiveRepository.archiveMessage()  WARNING: Adding tag for 161 = #Test123
2017-03-15 17:49:48.328 [in_13-message-archive]  JDBCMessageArchiveRepository.archiveMessage()  WARNING: Executing batch!
Andrzej Wójcik (Tigase) commented 8 years ago

Wojciech Kapcia wrote:

Andrzej Wójcik wrote:

Most of issues was caused by lack of precision in MySQL database schema - timestamp was used instead of @timestamp(6)@. While I was running TTS-NG before I was using PostgreSQL as a database which has better precision related to stored timestamps. As MUC is already using @timestamp(6)@, I updated other schemas to use timestamps with higher precision as well.

We need to bring back TTS nightlies in jenkins pronto, and probably finally configure TTS-NG as well, but for that we need sane defaults that we can quickly copy and provide configuration to the server.

Yes, we need this, as not this task started to be a bag for all issues related to TTS-NG, test configuration issues, issues related to new changes in code, etc.

Here is a list of issues and tests which were failing because of each issue:

  • Schema for Tigase fails on MySQL 5.7 - not possible to set default 0 for timestamp:

Thanks, there was a related issue reported with this!

With the:

[...]

I still see following tests falling:

  • TestMessageArchiveManagement.testMessageRetrievalWithNonEmptyResultsWithQuery:197->testMessageRerieval:253->testMessageRerieval:305 expected:<16> but was:<17> -- when run with $ mvn test ~~Dtest=tigase.tests.archive.TestMessageArchiveManagement$testMessageRetrievalWithNonEmptyResultsWithQuery (btw. there are two equally named test ~~ the other being for MUC and it's difficult to know which one failed from the report)
  • TestMessageArchivingMUC.testArchivingOfMucMessages:146->assertArchivedMessages:323 null: lists don't have the same size expected [2] but found [3]
  • TestMessageArchiveManagement.testMessageRetrievalWithNonEmptyResultsWithQuery:197->testMessageRerieval:253->testMessageRerieval:305 expected:<16> but was:<17>

This tests are passing for me. This issues were related to timing and usage of timestamp instead of timestamp(6) - timestamp precision issue, and were fixed by changes in schema. Could you verify that you have newest version of schema applied on DB and rerun this tests?

We should consider to improve TTS-NG so it would automatically register admin accounts so automatic tests will be better as while I was running tests on empty DB I forgot to create admin user.

Can be a good idea, especially for other domains (e.g. test of two-way TLS)

Right now it is required to manually prepare admin users, nodes, etc. This is not a good idea, and it is easy to forget about something. If we provide TTS-NG to everyone so, they could test it, it need to be automatic as much as possible to deal with possible configuration issues on user side leading user to believe that our software is buggy (as tests will be failing).

I think we should also automatically create PubSub node and subscribe admin to it for TestOfflineMessageSinkProvider

Looking at the code - there was a code doing that but it's commented out?

I think you should ask Bartosz about that, as he is author of this test and he removed this part (commented out).

We are now left with following errors:

  • SCRAM-SHA1 is not checking if user is active or not!

** TestAdminUI.testModifyUser:260 expected [false] but found [true]

This needs to be fixed in server source code as SCRAM retrieves password without checking if account is disabled or not.

That's another problem (vide: #5076) - I've created: #5084

OK

  • Test of server monitoring left with "Mail with notification not received expected [true] but found [false]" but task was disabled

** TestServerMonitoring.testTigaseXMPPServerMonitoring:150->disableTaskConfig:71 SampleTask can't be disabled! expected [true] but found [false]

If I'm correct it is now required to have a running mail server for this test to pass - not a good idea for automatic tests.

Why this task can't be disabled?

I'm not sure. I think it would be best to delegate this to person who created this feature and test to verify it.

When running the tests I've encoutered a couple of more problems:

  • #5085: Too many beans implemented class class tigase.monitor.MonitorComponent
  • #5086: NPE in MonitorComponent at addTimerTask
  • lot's of log entries in tigase-console.log (changing of log level will fix it):

[...]

This is fixed now.

wojciech.kapcia@tigase.net commented 8 years ago

Andrzej Wójcik wrote:

Wojciech Kapcia wrote:

Andrzej Wójcik wrote:

Most of issues was caused by lack of precision in MySQL database schema - timestamp was used instead of @timestamp(6)@. While I was running TTS-NG before I was using PostgreSQL as a database which has better precision related to stored timestamps. As MUC is already using @timestamp(6)@, I updated other schemas to use timestamps with higher precision as well.

We need to bring back TTS nightlies in jenkins pronto, and probably finally configure TTS-NG as well, but for that we need sane defaults that we can quickly copy and provide configuration to the server.

Yes, we need this, as not this task started to be a bag for all issues related to TTS-NG, test configuration issues, issues related to new changes in code, etc.

Created #5205.

I'll work on it ASAP.

One thing that seems to be missing is ability to reference various databases while maintaining common init-properties (then the only thing changing is the JDBC url thus chances of skipping some property in one database is smaller) - is it possible to have something like this with DSL config format? AFAIR now it only supports one property file? (this can be followed-up in different ticket if appropriate)

With the:

[...]

I still see following tests falling:

  • TestMessageArchiveManagement.testMessageRetrievalWithNonEmptyResultsWithQuery:197->testMessageRerieval:253->testMessageRerieval:305 expected:<16> but was:<17> -- when run with $ mvn test ~~Dtest=tigase.tests.archive.TestMessageArchiveManagement$testMessageRetrievalWithNonEmptyResultsWithQuery (btw. there are two equally named test ~~ the other being for MUC and it's difficult to know which one failed from the report)
  • TestMessageArchivingMUC.testArchivingOfMucMessages:146->assertArchivedMessages:323 null: lists don't have the same size expected [2] but found [3]
  • TestMessageArchiveManagement.testMessageRetrievalWithNonEmptyResultsWithQuery:197->testMessageRerieval:253->testMessageRerieval:305 expected:<16> but was:<17>

This tests are passing for me. This issues were related to timing and usage of timestamp instead of timestamp(6) - timestamp precision issue, and were fixed by changes in schema. Could you verify that you have newest version of schema applied on DB and rerun this tests?

I've re-run the tests with the latest nightly, new database and latest stable MySQL5.7 and those tests passed (i.e. no more discrepant number of returned items).

We should consider to improve TTS-NG so it would automatically register admin accounts so automatic tests will be better as while I was running tests on empty DB I forgot to create admin user.

Can be a good idea, especially for other domains (e.g. test of two-way TLS)

Right now it is required to manually prepare admin users, nodes, etc. This is not a good idea, and it is easy to forget about something. If we provide TTS-NG to everyone so, they could test it, it need to be automatic as much as possible to deal with possible configuration issues on user side leading user to believe that our software is buggy (as tests will be failing).

#5207

I think we should also automatically create PubSub node and subscribe admin to it for TestOfflineMessageSinkProvider

Looking at the code - there was a code doing that but it's commented out?

I think you should ask Bartosz about that, as he is author of this test and he removed this part (commented out).

%bmalkow can you comment on the issue shortly? Why you skipped out in the end creation of the required node within the test? Was it that it was possible to configure different name?

%andrzej.wojcik %bmalkow - possibly a followup in #5207?

  • Test of server monitoring left with "Mail with notification not received expected [true] but found [false]" but task was disabled

** TestServerMonitoring.testTigaseXMPPServerMonitoring:150->disableTaskConfig:71 SampleTask can't be disabled! expected [true] but found [false]

If I'm correct it is now required to have a running mail server for this test to pass - not a good idea for automatic tests.

Why this task can't be disabled?

I'm not sure. I think it would be best to delegate this to person who created this feature and test to verify it.

When running the tests I've encoutered a couple of more problems:

  • #5085: Too many beans implemented class class tigase.monitor.MonitorComponent
  • #5086: NPE in MonitorComponent at addTimerTask
  • lot's of log entries in tigase-console.log (changing of log level will fix it):

[...]

This is fixed now.

As I mentioned - almost all works for me now so I would close this issue and focus on automatic tests (and fix issues detected on the nightly basis).

Andrzej Wójcik (Tigase) commented 8 years ago

One thing that seems to be missing is ability to reference various databases while maintaining common init-properties (then the only thing changing is the JDBC url thus chances of skipping some property in one database is smaller) - is it possible to have something like this with DSL config format? AFAIR now it only supports one property file? (this can be followed-up in different ticket if appropriate)

It is possible to use variables now, so you can set environment variable and in DSL file reference to use value of following environment variable as a database URI.

wojciech.kapcia@tigase.net commented 8 years ago

Thank you Andrzej, closing the issue.

issue 1 of 1
Type
Task
Priority
Normal
Assignee
RedmineID
4348
Version
tigase-server-8.0.0
Spent time
260h
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#692
Please wait...
Page is in error, reload to recover