Skip to content
Permalink
Browse files

[tests] Server connection timeout

  • Loading branch information
elpaso committed Nov 3, 2016
1 parent 4fe9a8b commit c54d9d8eeedebd3e47141de354782c3df9c8db12
@@ -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()
@@ -604,7 +590,6 @@ void QgsIdentifyResultsDialog::mapLayerActionDestroyed()
}
}


QgsIdentifyPlotCurve::QgsIdentifyPlotCurve( const QMap<QString, QString> &attributes,
QwtPlot* plot, const QString &title, QColor color )
{
@@ -31,8 +31,6 @@

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

class QCloseEvent;
class QTreeWidgetItem;
@@ -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;
@@ -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

@@ -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

0 comments on commit c54d9d8

Please sign in to comment.
You can’t perform that action at this time.