@Test
	public void testActivateTraceChangeLanguage() throws Exception {
		assertEquals(PCLocationTrackingSpec.INSTANCE,
			listingProvider.actionTrackLocation.getCurrentUserData());

		createSnaplessTrace("x86:LE:64:default");

		try (ToyDBTraceBuilder tb2 =
			new ToyDBTraceBuilder("dynamic2-" + name.getMethodName(), "dsPIC33F:LE:24:default")) {

			TraceThread thread1;
			try (Transaction tx = tb.startTransaction()) {
				tb.trace.getTimeManager().createSnapshot("First");
				tb.trace.getMemoryManager()
						.createRegion(".text", 0, tb.range(0x00400000, 0x0040ffff),
							TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
				thread1 = tb.getOrAddThread("Thread1", 0);
				tb.exec(0, thread1, 0, "RIP = 0x00400000;");
			}

			TraceThread thread2;
			try (Transaction tx = tb2.startTransaction()) {
				tb2.trace.getTimeManager().createSnapshot("First");
				tb2.trace.getMemoryManager()
						.createRegion(".text", 0, tb2.range(0x200, 0x3ff), TraceMemoryFlag.READ,
							TraceMemoryFlag.EXECUTE);
				thread2 = tb2.getOrAddThread("Thread2", 0);
				tb2.exec(0, thread2, 0, "PC = 0x100;");
			}

			traceManager.openTrace(tb.trace);
			traceManager.openTrace(tb2.trace);

			traceManager.activateThread(thread1);
			waitForSwing();

			traceManager.activateThread(thread2);
			waitForSwing();

			assertFalse(listingProvider.locationLabel.getText().startsWith("(error)"));
		}
	}
Because goToDyn has to retry, it can generate many read requests. Turn off auto-read and
then flush out any pending reads, so that all the tasks can complete.
Ghidra/Test/DebuggerIntegrationTest/src/test/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProviderTest.java