Skip to content

Commit c04c579

Browse files
committedMay 17, 2020
Hopefully this fixes hang on windows in tests
1 parent 6254927 commit c04c579

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎tests/src/gui/testqgsogrprovidergui.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ void TestQgsOgrProviderGui::testGpkgDataItemRename()
9898
}
9999
QVERIFY( itemLayer1 );
100100

101+
QSignalSpy spyDataChanged( &gpkgItem, &QgsDataItem::dataChanged );
102+
101103
// try to rename
102104
const QList<QgsDataItemGuiProvider *> providers = QgsGui::dataItemGuiProviderRegistry()->providers();
103105
bool success = false;
@@ -112,6 +114,13 @@ void TestQgsOgrProviderGui::testGpkgDataItemRename()
112114
}
113115
QVERIFY( success );
114116

117+
// gpkg item gets refreshed in the background and there will be multiple dataChanged signals
118+
// emitted unfortunately, so let's just wait until no more data changes signals are coming.
119+
// Animation of "loading" icon also triggers dataChanged() signals, making even the number
120+
// of signals unpredictable...
121+
while ( spyDataChanged.wait( 500 ) )
122+
;
123+
115124
// Check that the style is still available
116125
QgsVectorLayer metadataLayer( QStringLiteral( "/%1|layername=layer_styles" ).arg( fileName ) );
117126
QVERIFY( metadataLayer.isValid() );

0 commit comments

Comments
 (0)
Please sign in to comment.