'And then I woke up' is the standard ending to a large percentage of stories written by children. Having described exciting and impossible adventures with space ships, knights, talking rabbits, flying houses, large red dragons, etc., and written themselves into a corner there is no way to bring the story back to a coherent, logical ending.

'Oh, it was all a dream!' is the best possible cop-out if you run out of steam or can't find an answer to why the very large monster has not wiped out the city.

Every primary school teacher has seen thousands upon thousands of versions of this ending. Almost every primary school teacher has been reduced to a whimpering wreck when finding ten of these in every pile of a dozen stories. Soap opera devotees may also have run across one or seventeen examples of this literary device.

But even John Bunyan was guilty of this, "oh well, now what?" sort of ending. Pilgrim's Progress concludes with the classically dreadful line:
"So I awoke, and behold it was a dream."