Run ant test-class -Dclass=LayoutPersistenceTest
It randomly generates longs for every field that accepts a long.
By default, LayoutPersistenceTest also has a com.liferay.portal.model.LayoutListener,com.liferay.portal.service.impl.LayoutSetPrototypeLayoutListener
When a layout is deleted (which LayoutPersistenceTest tests), it will have a random group id (that LayoutPersistenceTest generated) and will print an error. It never threw an exception, so all tests passed, but the stack trace was ugly to look at.
I made a DummyModelListener, and in portal-test.properties, set all those there.