The only time I can recall that I did anything with near certainty that it would result in a caning, was to skip detention. On each other occasion, I was punished, it was for an act that I knew carried the risk of punishment, but my intention was to avoid detection.
Actually, as I write, a couple of incidents spring to mind where that may not have been the case. One was where, (egged on by a couple of girls I was showing off to), I fired a paper pellet at a stand-in teacher. He went ballistic. After he had accused a couple of others, I eventually owned up in the certainty that I was in deep trouble. Sure enough, he frog-marched me straight down to the Headmaster’s office.