mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
Tests - fixed test broken due to impedance between wait time and slow
test environment
This commit is contained in:
parent
c497e95434
commit
6adb6fb5e5
1 changed files with 3 additions and 18 deletions
|
@ -15,9 +15,7 @@
|
|||
*/
|
||||
package docking.widgets.table;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Container;
|
||||
|
@ -452,7 +450,7 @@ public class SelectionManagerTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
private void waitForTableModel() {
|
||||
if (table.getModel() instanceof ThreadedTestTableModel) {
|
||||
waitForThreadedModel();
|
||||
waitForTableModel(threadedModel);
|
||||
}
|
||||
else {
|
||||
waitForSwing();
|
||||
|
@ -468,20 +466,7 @@ public class SelectionManagerTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
SwingUtilities.invokeAndWait(
|
||||
() -> threadedModel.setTableFilter(factory.getTableFilter(text, transformer)));
|
||||
|
||||
waitForThreadedModel();
|
||||
}
|
||||
|
||||
private void waitForThreadedModel() {
|
||||
int numWaits = 0;
|
||||
int sleepyTime = 10;
|
||||
int maxWaits = ((MAX_ROW_COUNT + 1) * MAX_THREAD_SLEEP_DELAY) / sleepyTime;
|
||||
|
||||
while (threadedModel.isBusy() && numWaits < maxWaits) {
|
||||
numWaits++;
|
||||
sleep(sleepyTime);
|
||||
}
|
||||
assertTrue("Threaded table model never finished work!", numWaits < maxWaits);
|
||||
waitForSwing();
|
||||
waitForTableModel();
|
||||
}
|
||||
|
||||
private int getOtherNonDuplicateRowIndex(int dup1Index,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue