I might be somewhat a little rick. But in my case it is the managment responsibility to set the expectation.
If a task takes 5 days to complete but your manager says I need build at the end of day. You can not deny it and you have no other option but to patch.
Let's assume another scenario. If your manager says he needs
build at the end of day and you are spending 5 days to just write the beautiful thoughtful code than what will happen. You loose your creadibility and no one will trust you and say you are rockstar.
Then you will be fired like dumb.