@Override
				public boolean analysisWorkerCallback(Program p, Object workerContext,
						TaskMonitor monitor) throws Exception, CancelledException {

					// Click Cancel on modal blocker dialog 
					Window blockerDialog = waitForWindow("CancelTest");
					assertNotNull(blockerDialog);
					pressButtonByText(blockerDialog, "Cancel");

					Window confirmDialog = waitForWindow("Cancel?");
					assertNotNull(confirmDialog);
					pressButtonByText(confirmDialog, "Yes");
					waitForSwing();

					monitor.checkCancelled();

					Assert.fail("CancelledException expected");

					return false;
				}
Test attempt to run an AnalysisWorker from swing thread
@throws Exception
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/AutoAnalysisWorkerTest.java