Dietary restriction (DR), limiting calories or specific nutrients, extends lifespan across diverse taxa. This lifespan extension has been explained as diet-mediated changes in the trade-off between lifespan and reproduction, with survival favoured with scarce resources. Another evolutionary hypothesis suggests the selective benefit of the response is the maintenance of reproduction. This hypothesis predicts that lifespan extension is a side effect of benign laboratory conditions, where DR individuals are frailer and unable to deal with additional stressors, and thus lifespan extension should disappear under more stressful conditions. We tested this by rearing outbred female Drosophila melanogaster on 10 different protein:carbohydrate diets. Flies were either infected with a bacterial pathogen (Pseudomonas entomophila), injured or unstressed. We monitored lifespan, fecundity and ageing measures. DR extended lifespan and reduced reproduction irrespective of injury and infection. These results do not support lifespan extension under DR being a side effect of benign laboratory conditions.