@Test
	public void testEmulateInterruptAction() throws Throwable {
		TraceThread thread = createToyLoopTrace();
		controlService.setCurrentMode(tb.trace, ControlMode.RW_EMULATOR);

		traceManager.activateThread(thread);
		waitForSwing();

		assertFalse(controlPlugin.actionEmulateInterrupt.isEnabled());

		CompletableFuture<EmulationResult> future = emulationService.backgroundRun(tb.host,
			TraceSchedule.snap(0), Scheduler.oneThread(thread));
		waitForPass(() -> assertTrue(controlPlugin.actionEmulateInterrupt.isEnabled()));

		performEnabledAction(null, controlPlugin.actionEmulateInterrupt, true);
		EmulationResult result = waitOn(future);
		assertTrue(result.error() instanceof SuspendedPcodeExecutionException);
		waitForTasks();

		assertFalse(controlPlugin.actionEmulateInterrupt.isEnabled());
	}
Tests the UI so it does not error when the user presses resume after already stepped into a
pcode instruction.
Ghidra/Test/DebuggerIntegrationTest/src/test/java/ghidra/app/plugin/core/debug/gui/control/DebuggerControlPluginTest.java