As far as I know, when you leave US with your petition in pending status, it will get voided and you might have to apply for a new petition again when you are back to US.
If you still have time for your COPR expiry, I would suggest you to wait till you get your H4 approved.