@Before
  public void setUp() {
    VM datastore1 = getVM(0);
    VM datastore2 = getVM(1);

    String regionName = getClass().getSimpleName() + "_" + testName.getMethodName();

    // create stores on all VMs including controller
    datastore1.invoke(() -> createPartitionedRegion(regionName));
    datastore2.invoke(() -> createPartitionedRegion(regionName));

    createPartitionedRegion(regionName);

    datastore1.invoke(this::registerThrowsExceptionFunction);
    datastore2.invoke(this::registerThrowsExceptionFunction);

    registerThrowsExceptionFunction();

    execution = FunctionService.onRegion(cacheRule.getCache().getRegion(regionName));
    ((InternalExecution) execution).setWaitOnExceptionFlag(true);
  }
TRAC #41779: InternalExecution.setWaitOnExceptionFlag(true) does not add the exception from the
local node to the FunctionException list of exceptions

<p>
Extracted from {@link PRFunctionExecutionDUnitTest}.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/FunctionExceptionsIncludeLocalMemberRegressionTest.java