diff --git a/.changes/v2.19.0/537-bug-fixes.md b/.changes/v2.19.0/537-bug-fixes.md index 3a6380b3a..384b312d2 100644 --- a/.changes/v2.19.0/537-bug-fixes.md +++ b/.changes/v2.19.0/537-bug-fixes.md @@ -1 +1 @@ -* Remove URL checks from `CreateCatalogFromSubscriptionAsync` to allow catalog creation from non-VCD entities, such as vSphere shared library [GH-537] +* Removed URL checks from `CreateCatalogFromSubscriptionAsync` to allow catalog creation from non-VCD entities, such as vSphere shared library [GH-537] diff --git a/.changes/v2.19.0/540-bug-fixes.md b/.changes/v2.19.0/540-bug-fixes.md new file mode 100644 index 000000000..441e8ac7d --- /dev/null +++ b/.changes/v2.19.0/540-bug-fixes.md @@ -0,0 +1 @@ +* Fixed flaky test `Test_CatalogAccessAsOrgUsers` that failed randomly for timing issues [GH-540] diff --git a/govcd/catalog_test.go b/govcd/catalog_test.go index 72f5226ca..9d94ea9b3 100644 --- a/govcd/catalog_test.go +++ b/govcd/catalog_test.go @@ -1226,6 +1226,15 @@ func (vcd *TestVCD) Test_CatalogAccessAsOrgUsers(check *C) { check.Assert(adminCatalog1FromOrg.AdminCatalog.HREF, Equals, adminCatalog1AsSystem.AdminCatalog.HREF) check.Assert(adminCatalog2FromOrg.AdminCatalog.HREF, Equals, adminCatalog1AsSystem.AdminCatalog.HREF) check.Assert(catalog2FromOrg.Catalog.HREF, Equals, catalog1AsSystem.Catalog.HREF) - err = adminCatalog1AsSystem.Delete(true, true) + timeout = 30 * time.Second + startTime = time.Now() + for time.Since(startTime) < timeout { + err = adminCatalog1AsSystem.Delete(true, true) + if err == nil { + fmt.Printf("shared catalog deleted in %s\n", time.Since(startTime)) + break + } + time.Sleep(200 * time.Millisecond) + } check.Assert(err, IsNil) }