When defining a pipeline project and using the following pipeline definition, the jobs gets stuck in "Recording Test Results":
Makes it work. This is unrelated to the AttachementPublisher plugin - the same happens for any testDataPublishers.
I have debugged it a bit and it seems the root cause if somehow that an AbstractMethodError is thrown from hudson.tasks.junit.TestDataPublisher when it is run from a pipeline (I guess because the pipeline project does not derive from AbstractBuild but from Run).
In any case, returning "null" in TestDataPublisher.contributeTestData() instead of throwing an exception at least prevents getting stuck - it of course does not solve the underlying problem.
Possibly related to