@Test
	public void testAskLanguage() throws Exception {
		createScript();

		LanguageCompilerSpecPair[] myLang = new LanguageCompilerSpecPair[1];

		runSwing(() -> {
			try {
				myLang[0] = script.askLanguage("Ask Test", "Give me a language:");
			}
			catch (Exception e) {
				failWithException("Exception was caught in this test: " + e.getMessage(), e);
			}
		}, false);

		SelectLanguageDialog langDialog = waitForDialogComponent(SelectLanguageDialog.class);
		assertNotNull(langDialog);
		pressButtonByText(langDialog, "Give me a language:");
		waitForSwing();

		// Compare default value to expected properties value
		assertEquals(new LanguageCompilerSpecPair("6502:LE:16:default", "default"), myLang[0]);

		// Set language do something else
		runSwing(() -> {
			try {
				myLang[0] = script.askLanguage("Ask Test", "Give me a language:");
			}
			catch (Exception e) {
				failWithException("Exception was caught in this test: " + e.getMessage(), e);
			}
		}, false);

		langDialog = waitForDialogComponent(SelectLanguageDialog.class);

		LanguageCompilerSpecPair chosenLang =
			new LanguageCompilerSpecPair("68000:BE:32:Coldfire", "default");
		langDialog.setSelectedLanguage(chosenLang);
		waitForSwing();

		pressButtonByText(langDialog, "Give me a language:");
		waitForSwing();

		// Verify that the last-chosen language is auto-populated in the dialog box
		runSwing(() -> {
			try {
				myLang[0] = script.askLanguage("Ask Test", "Give me a language:");
			}
			catch (Exception e) {
				failWithException("Exception was caught in this test: " + e.getMessage(), e);
			}
		}, false);

		langDialog = waitForDialogComponent(SelectLanguageDialog.class);

		pressButtonByText(langDialog, "Give me a language:");
		waitForSwing();

		assertEquals(chosenLang, myLang[0]);

	}
A large timeout period that is usually not reached
Ghidra/Features/Base/src/test.slow/java/ghidra/app/script/GhidraScriptAskMethodsTest.java