Add unit tests for keepProcess flag