My rule is:
If you can’t order, eat, and pay by 10 minutes before closing, then don’t go in to a proper, full-service restaurant. That’s what fast food and all-night diners are for.
And if it can’t be helped and your server is scrambling to get your order taken care of, leave a generous tip. But you should know that…