Skip to content

Commit 90b0d4e

Browse files
Issue 52277: SNDTest.testSuperPackageApis fails with DB deadlock (#974)
* Issue 52277: SNDTest.testSuperPackageApis fails with Transaction DeadLock * Restore original error checking
1 parent 167f7c0 commit 90b0d4e

1 file changed

Lines changed: 19 additions & 16 deletions

File tree

snd/test/src/org/labkey/test/tests/snd/SNDTest.java

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,7 @@ public void preTest()
10481048
//TODO: once exp tables are exposed - do a full cleanup from snd.pkgs, exp.DomainDescriptor, exp.PropertyDomain, exp.PropertyDescriptor
10491049
}
10501050

1051+
@SuppressWarnings("JUnit3StyleTestMethodInJUnit4Class") // Explicitly called as part of setup
10511052
public void testSNDImport()
10521053
{
10531054
//go to SND Project
@@ -1264,7 +1265,7 @@ public void cloneDraftPackage()
12641265
assertEquals("2", fairReviewRow.getMin());
12651266
assertEquals("7", fairReviewRow.getMax());
12661267
assertEquals(":-)", fairReviewRow.getDefault());
1267-
assertEquals(true, fairReviewRow.getRequired());
1268+
assertTrue(fairReviewRow.getRequired());
12681269
assertEquals("lol", fairReviewRow.getRedactedText());
12691270
}
12701271

@@ -1404,7 +1405,7 @@ public void saveNewPackage()
14041405
assertEquals("2", reviewRow.getMin());
14051406
assertEquals("7", reviewRow.getMax());
14061407
assertEquals("men", reviewRow.getDefault());
1407-
assertEquals(true, reviewRow.getRequired());
1408+
assertTrue(reviewRow.getRequired());
14081409
assertEquals("and women", reviewRow.getRedactedText());
14091410
}
14101411

@@ -1545,11 +1546,11 @@ public void editCategories() throws Exception
15451546

15461547
CategoryEditRow surgeryRowCat = catPage.getCategory("Surgery");
15471548
assertNotNull("Surgery category should exist", surgeryRowCat);
1548-
assertEquals("Surgery category should be active", true, surgeryRowCat.getIsActive());
1549+
assertTrue("Surgery category should be active", surgeryRowCat.getIsActive());
15491550

15501551
CategoryEditRow ourCat = catPage.getCategory(editedCategory);
15511552
assertNotNull("test edit category should exist", ourCat);
1552-
assertEquals("test edit category should be inactive", false, ourCat.getIsActive());
1553+
assertFalse("test edit category should be inactive", ourCat.getIsActive());
15531554
assertEquals("test edit category should have new description", editedCategory, ourCat.getDescription());
15541555

15551556
SelectRowsCommand catsCmd = new SelectRowsCommand("snd", "PkgCategories");
@@ -1803,12 +1804,17 @@ public void testProjectApis() throws Exception
18031804
public void testSuperPackageApis() throws Exception
18041805
{
18051806
goToProjectHome();
1806-
goToSchemaBrowser();
18071807

18081808
//insert super package
18091809
runScript(SAVEPACKAGEAPI_CHILDREN);
18101810
goToSchemaBrowser();
1811-
viewQueryData("snd", "SuperPkgs");
1811+
selectQuery("snd", "SuperPkgs");
1812+
// Issue 52277: Be sure that the call to analyze the query has completed by waiting for the dependency report,
1813+
// ensuring it won't be chosen as a deadlock victim
1814+
waitForText("Dependency Report");
1815+
Locator viewData = Locator.linkWithText("view data");
1816+
waitAndClickAndWait(viewData);
1817+
18121818
assertTextPresent(TEST_SUPER_PKG_DESCRIPTION_1, 1);
18131819
checkResults(TEST_SUPER_PKG_DESCRIPTION_1,
18141820
Arrays.asList(TEST_SUPER_PKG_START_ID1 + 1, // top-level super package is the + 0, so start at + 1
@@ -1818,8 +1824,7 @@ public void testSuperPackageApis() throws Exception
18181824

18191825
//update super package without cloning, with children
18201826
runScript(UPDATESUPERPACKAGEAPI_CHILDREN);
1821-
goToSchemaBrowser();
1822-
viewQueryData("snd", "SuperPkgs");
1827+
refresh();
18231828
assertTextPresent(TEST_SUPER_PKG_DESCRIPTION_2, 1);
18241829
assertTextNotPresent(TEST_SUPER_PKG_DESCRIPTION_1);
18251830
checkResults(TEST_SUPER_PKG_DESCRIPTION_2,
@@ -1832,8 +1837,7 @@ public void testSuperPackageApis() throws Exception
18321837

18331838
//update super package with cloning
18341839
runScript(UPDATESUPERPACKAGEAPI_CLONE);
1835-
goToSchemaBrowser();
1836-
viewQueryData("snd", "SuperPkgs");
1840+
refresh();
18371841
assertTextPresent(TEST_SUPER_PKG_DESCRIPTION_3, 1);
18381842
assertTextPresent(TEST_SUPER_PKG_DESCRIPTION_2, 1);
18391843
checkResults(TEST_SUPER_PKG_DESCRIPTION_3,
@@ -1846,8 +1850,7 @@ public void testSuperPackageApis() throws Exception
18461850

18471851
//update super package without cloning, without children
18481852
runScript(UPDATESUPERPACKAGEAPI_NOCHILDREN);
1849-
goToSchemaBrowser();
1850-
viewQueryData("snd", "SuperPkgs");
1853+
refresh();
18511854
assertTextPresent(TEST_SUPER_PKG_DESCRIPTION_4, 1);
18521855
assertTextPresent(TEST_SUPER_PKG_DESCRIPTION_3, 1);
18531856
assertTextNotPresent(TEST_SUPER_PKG_DESCRIPTION_2);
@@ -2170,7 +2173,7 @@ public void categoryPermissionsUI() throws Exception
21702173
{
21712174
value = getPermissionTableValue(i, 1);
21722175
assertNotNull(value);
2173-
assertTrue(value.equals("None"));
2176+
assertEquals("None", value);
21742177
categoryRows.add(i);
21752178
}
21762179
}
@@ -2182,7 +2185,7 @@ public void categoryPermissionsUI() throws Exception
21822185
{
21832186
value = getPermissionTableValue(r, 1);
21842187
assertNotNull(value);
2185-
assertTrue(value.equals("SND Reader"));
2188+
assertEquals("SND Reader", value);
21862189
}
21872190

21882191
findButton("Clear All").click();
@@ -2192,7 +2195,7 @@ public void categoryPermissionsUI() throws Exception
21922195
{
21932196
value = getPermissionTableValue(categoryRows.get(k), 1);
21942197
assertNotNull(value);
2195-
assertTrue(value.equals("None"));
2198+
assertEquals("None", value);
21962199
click(getSimpleTableCell(Locator.id("category-security"), categoryRows.get(k), 1));
21972200
clickRoleInOpenDropDown(permissions.get(k));
21982201
}
@@ -2203,7 +2206,7 @@ public void categoryPermissionsUI() throws Exception
22032206
{
22042207
value = getPermissionTableValue(categoryRows.get(j), 1);
22052208
assertNotNull(value);
2206-
assertTrue(value.equals(permissions.get(j)));
2209+
assertEquals(value, permissions.get(j));
22072210
}
22082211

22092212
}

0 commit comments

Comments
 (0)