juliocamarero/liferay-portal — pull request #2167 by matethurzo (2013-07-22 14:27:24+00:00)
Title: LPS-37901 Correct test fix

Hey Julio,

As you seen my email about clearing the thread locals in tests, I'm going to send a PR to Miguel with the test framework addition later, but in the meantime I've fixed the Layout and LayoutSetPrototypePropagation tests, so I'm submitting this to you, and later on I'll submit the changes to Miguel.

Although, I've described the problem in the ticket, I'm adding the root cause here as well just for the record; the original problem was we record the information if a layout prototype has been propagated in a thread local variable. Due to the nature of the tests we are propagating the prototypes multiple times but any subsequent propagation after the first one won't run because it has been already completed, so the test will fail. So after all the problem is not the test logic, and I haven't touched it.

Once I'm clearing the thread local the tests are running correctly.

This situation should never happen when using the portal normally according to the request/response style of the operation and the fact that the new requests will be executed in new threads.

Thanks,

Máté

cc: @epgarcia