Skip to content

Commit c54d9d8

Browse files
committed
[tests] Server connection timeout
1 parent 4fe9a8b commit c54d9d8

File tree

4 files changed

+12
-21
lines changed

4 files changed

+12
-21
lines changed

src/app/qgsidentifyresultsdialog.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,6 @@ QgsIdentifyResultsWebView::QgsIdentifyResultsWebView( QWidget *parent ) : QgsWeb
7575
#ifdef QGISDEBUG
7676
settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled, true );
7777
#endif
78-
page()->setForwardUnsupportedContent( true );
79-
connect( page(), SIGNAL( downloadRequested( QNetworkRequest ) ), this, SLOT( download( QNetworkRequest ) ) );
80-
connect( page(), SIGNAL( unsupportedContent( QNetworkReply* ) ), this, SLOT( unsupportedContent( QNetworkReply* ) ) );
81-
82-
}
83-
84-
void QgsIdentifyResultsWebView::download( QNetworkRequest request )
85-
{
86-
qDebug() << "Download Requested: " << request.url();
87-
}
88-
89-
void QgsIdentifyResultsWebView::unsupportedContent( QNetworkReply *reply )
90-
{
91-
qDebug() << "Unsupported Content: " << reply->url();
9278
}
9379

9480
void QgsIdentifyResultsWebView::print()
@@ -604,7 +590,6 @@ void QgsIdentifyResultsDialog::mapLayerActionDestroyed()
604590
}
605591
}
606592

607-
608593
QgsIdentifyPlotCurve::QgsIdentifyPlotCurve( const QMap<QString, QString> &attributes,
609594
QwtPlot* plot, const QString &title, QColor color )
610595
{

src/app/qgsidentifyresultsdialog.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131

3232
#include <QWidget>
3333
#include <QList>
34-
#include <QNetworkRequest>
35-
#include <QNetworkReply>
3634

3735
class QCloseEvent;
3836
class QTreeWidgetItem;
@@ -59,8 +57,6 @@ class APP_EXPORT QgsIdentifyResultsWebView : public QgsWebView
5957
QSize sizeHint() const override;
6058
public slots:
6159
void print();
62-
void download( QNetworkRequest request );
63-
void unsupportedContent( QNetworkReply* reply );
6460
protected:
6561
void contextMenuEvent( QContextMenuEvent* ) override;
6662
QgsWebView *createWindow( QWebPage::WebWindowType type ) override;

src/providers/postgres/qgspostgresconn.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ QgsPostgresConn::QgsPostgresConn( const QString& conninfo, bool readOnly, bool s
209209
// expand connectionInfo
210210
QgsDataSourceURI uri( conninfo );
211211
QString expandedConnectionInfo = uri.connectionInfo( true );
212-
QgsMessageLog::logMessage( tr( "Connection info: " ) + expandedConnectionInfo );
213212

214213
mConn = PQconnectdb( expandedConnectionInfo.toLocal8Bit() ); // use what is set based on locale; after connecting, use Utf8
215214

tests/src/python/test_authmanager_pki_postgres.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,18 @@ def setUpClass(cls):
150150
cls.server = subprocess.Popen([os.path.join(QGIS_POSTGRES_EXECUTABLE_PATH, 'postgres'), '-D',
151151
cls.data_path, '-c',
152152
"config_file=%s" % cls.pg_conf],
153-
env=os.environ, stdout=subprocess.PIPE)
153+
env=os.environ,
154+
stdout=subprocess.PIPE,
155+
stderr=subprocess.PIPE)
156+
# Wait max 10 secs for the server to start
157+
end = time.time() + 10
158+
while True:
159+
line = cls.server.stderr.readline()
160+
print(line)
161+
if line.find("database system is ready to accept") != -1:
162+
break
163+
if time.time() > end:
164+
raise Exception("Timeout connecting to postgresql")
154165
# Create a DB
155166
subprocess.check_call([os.path.join(QGIS_POSTGRES_EXECUTABLE_PATH, 'createdb'), '-h', 'localhost', '-p', cls.port, 'test_pki'])
156167
# Inject test SQL from test path

0 commit comments

Comments
 (0)