If you have:
1. A work permit that still valid
2. An application to extend the work permit
3. A TRV that's still valid
You can leave and return to Canada as long as your work permit and TRV are still valid upon returning. I've done this a few times. On one occasion, I was questioned regarding my work permit's imminent expiry (within one month), so I provided proof of my application for an extension. This was at the Rainbow Bridge border in Niagara Falls.