Flies were subjected to one of three mild stresses known to have positive effects on longevity (heat, hypergravity, cold), prior to an infection with the entomopathogenic fungus Beauveria bassiana. Flies subjected to cold survived longer to infection, while the other mild stresses had no positive effect. These positive effects of a cold stress on resistance to infection were observed mainly in males and throughout life, i.e., a long time after the cold stress was applied. It was confirmed that cold and hypergravity stresses increased longevity of non-infected flies, but no positive effect of heat shocks were however observed.