Short answer is that you get used to it. There was a surprisingly effective swamp cooler that worked about half the time (we got pretty good at troubleshooting it) and several ancient pedestal fans. You can sleep in very nearly any environment once you become sufficiently sleep-deprived.