private Address createLabel(String addressString, String labelName) {
		Address labelAddress = getAddress(addressString);
		AddLabelCmd addCmd = new AddLabelCmd(labelAddress, labelName, SourceType.USER_DEFINED);
		addCmd.applyTo(program);
		program.flushEvents();

		SetLabelPrimaryCmd primaryCmd = new SetLabelPrimaryCmd(labelAddress, labelName, null);
		primaryCmd.applyTo(program);
		program.flushEvents();

		waitForSwing();
		waitForAnimation();
		return labelAddress;
	}
Waits for the run manager and any animation.
Ghidra/Features/FunctionGraph/src/test.slow/java/ghidra/app/plugin/core/functiongraph/AbstractFunctionGraphTest.java