mbroadst / qamqp

AMQP 0.9.1 implementation for Qt
Other
152 stars 130 forks source link

Fix of the issue "QAbstractSocket::connectToHost() called when already looking up or connecting/connected to xxxx" #49

Open johnzhanghua opened 8 years ago

johnzhanghua commented 8 years ago

In the test case networkDownThenUp(). If an network is down and up again, the retry of the connection will get the error "QAbstractSocket::connectToHost() called when already looking up or connecting/connected to xxxx". This will cause the reconnect fail.

Just simply add the socket->abort() after the _q_disconnect will fix the issue.

mbroadst commented 8 years ago

@johnzhanghua thanks for the contribution! looks like the test is failing though

johnzhanghua commented 8 years ago

@mbroadst sorry about the typo, as I use different host, username/password in my test case, just change it to your settings before delivery.

mbroadst commented 8 years ago

@johnzhanghua great, thanks. Now a final question: is it possible to run this test in less than 5min? That's going to take a somewhat serious toll on continuous integration 😄

johnzhanghua commented 8 years ago

@mbroadst , agree it is not a good test case. I might disable the test as you did for the autoReconnect one.

mbroadst commented 8 years ago

@johnzhanghua I haven't played with the code at all, but it seems like the issue could probably be triggered without having to wait as long. It looks like a test that should indeed be included, but if you don't have much time then I think it might be better moved to a manual test