Skip to content

Commit

Permalink
[tests] Server connection timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Nov 3, 2016
1 parent 4fe9a8b commit c54d9d8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 21 deletions.
15 changes: 0 additions & 15 deletions src/app/qgsidentifyresultsdialog.cpp
Expand Up @@ -75,20 +75,6 @@ QgsIdentifyResultsWebView::QgsIdentifyResultsWebView( QWidget *parent ) : QgsWeb
#ifdef QGISDEBUG
settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled, true );
#endif
page()->setForwardUnsupportedContent( true );
connect( page(), SIGNAL( downloadRequested( QNetworkRequest ) ), this, SLOT( download( QNetworkRequest ) ) );
connect( page(), SIGNAL( unsupportedContent( QNetworkReply* ) ), this, SLOT( unsupportedContent( QNetworkReply* ) ) );

}

void QgsIdentifyResultsWebView::download( QNetworkRequest request )
{
qDebug() << "Download Requested: " << request.url();
}

void QgsIdentifyResultsWebView::unsupportedContent( QNetworkReply *reply )
{
qDebug() << "Unsupported Content: " << reply->url();
}

void QgsIdentifyResultsWebView::print()
Expand Down Expand Up @@ -604,7 +590,6 @@ void QgsIdentifyResultsDialog::mapLayerActionDestroyed()
}
}


QgsIdentifyPlotCurve::QgsIdentifyPlotCurve( const QMap<QString, QString> &attributes,
QwtPlot* plot, const QString &title, QColor color )
{
Expand Down
4 changes: 0 additions & 4 deletions src/app/qgsidentifyresultsdialog.h
Expand Up @@ -31,8 +31,6 @@

#include <QWidget>
#include <QList>
#include <QNetworkRequest>
#include <QNetworkReply>

class QCloseEvent;
class QTreeWidgetItem;
Expand All @@ -59,8 +57,6 @@ class APP_EXPORT QgsIdentifyResultsWebView : public QgsWebView
QSize sizeHint() const override;
public slots:
void print();
void download( QNetworkRequest request );
void unsupportedContent( QNetworkReply* reply );
protected:
void contextMenuEvent( QContextMenuEvent* ) override;
QgsWebView *createWindow( QWebPage::WebWindowType type ) override;
Expand Down
1 change: 0 additions & 1 deletion src/providers/postgres/qgspostgresconn.cpp
Expand Up @@ -209,7 +209,6 @@ QgsPostgresConn::QgsPostgresConn( const QString& conninfo, bool readOnly, bool s
// expand connectionInfo
QgsDataSourceURI uri( conninfo );
QString expandedConnectionInfo = uri.connectionInfo( true );
QgsMessageLog::logMessage( tr( "Connection info: " ) + expandedConnectionInfo );

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

Expand Down
13 changes: 12 additions & 1 deletion tests/src/python/test_authmanager_pki_postgres.py
Expand Up @@ -150,7 +150,18 @@ def setUpClass(cls):
cls.server = subprocess.Popen([os.path.join(QGIS_POSTGRES_EXECUTABLE_PATH, 'postgres'), '-D',
cls.data_path, '-c',
"config_file=%s" % cls.pg_conf],
env=os.environ, stdout=subprocess.PIPE)
env=os.environ,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
# Wait max 10 secs for the server to start
end = time.time() + 10
while True:
line = cls.server.stderr.readline()
print(line)
if line.find("database system is ready to accept") != -1:
break
if time.time() > end:
raise Exception("Timeout connecting to postgresql")
# Create a DB
subprocess.check_call([os.path.join(QGIS_POSTGRES_EXECUTABLE_PATH, 'createdb'), '-h', 'localhost', '-p', cls.port, 'test_pki'])
# Inject test SQL from test path
Expand Down

0 comments on commit c54d9d8

Please sign in to comment.