I have a test method written by a third party that occasionally results in Apex CPU time limit errors. The part of the method that includes setting up a semi-large amount of data on multiple objects (Users, Accounts, Contacts) is the primary hog of the CPU time, and it would be impossible for a user to create all of it in a single transaction.
If I convert this to a @testSetup method in the class, do the CPU time limits apply to that method as well, even though it's not attempting to simulate user behavior and merely loading a bunch of test data? The documentation mentions that if a fatal error is encountered, it will roll back the transaction and cancel all test methods within the class, but doesn't mention specifically whether all limits apply within this context.
If a fatal error occurs during the execution of a test setup method, such as an exception that’s caused by a DML operation or an assertion failure, the entire test class fails, and no further tests in the class are executed.