Wow, that really depends on what type of race it is, competition level, what is on the line, and what tech will allow you to do at the track. Short of honing a block, I've just about rebuilt an entire engine on race day. Sometimes that means throwing in new parts, sometimes that means taking 2 engines and using parts off both to make 1 good engine, some times that means begging/borrowing in the pits to get the parts you need. I've reassembled a completely torn down engine in tech to reuse in another class later in the day. If you want to be there and you want to race, you do what you have to do to make it happen.
Then again, we have all had "one of those days" at the track where at some point you just say I'm done and pack it up and cut your losses.