Skip to content
Permalink
Browse files

Hopefully this fixes hang on windows in tests

  • Loading branch information
wonder-sk committed May 17, 2020
1 parent 6254927 commit c04c579684de2edd38df83f34a3bdc5089518ce2
Showing with 9 additions and 0 deletions.
  1. +9 −0 tests/src/gui/testqgsogrprovidergui.cpp
@@ -98,6 +98,8 @@ void TestQgsOgrProviderGui::testGpkgDataItemRename()
}
QVERIFY( itemLayer1 );

QSignalSpy spyDataChanged( &gpkgItem, &QgsDataItem::dataChanged );

// try to rename
const QList<QgsDataItemGuiProvider *> providers = QgsGui::dataItemGuiProviderRegistry()->providers();
bool success = false;
@@ -112,6 +114,13 @@ void TestQgsOgrProviderGui::testGpkgDataItemRename()
}
QVERIFY( success );

// gpkg item gets refreshed in the background and there will be multiple dataChanged signals
// emitted unfortunately, so let's just wait until no more data changes signals are coming.
// Animation of "loading" icon also triggers dataChanged() signals, making even the number
// of signals unpredictable...
while ( spyDataChanged.wait( 500 ) )
;

// Check that the style is still available
QgsVectorLayer metadataLayer( QStringLiteral( "/%1|layername=layer_styles" ).arg( fileName ) );
QVERIFY( metadataLayer.isValid() );

0 comments on commit c04c579

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