I read this sentence from the book Harry Potter:
Harry was frying eggs by the time Dudley arrived in the kitchen with his mother.
According to my dictionary, prep by here means before or not later than a particular time. It seems to suggest that past perfect tense should be used for this sentence. It would become:
Harry had been frying eggs by the time Dudley arrived in the kitchen with his mother.
That means Harry kept frying eggs till Dudley arrived in the kitchen with his mother.
However, I am confused by the original sentence. Does it mean Harry was still frying eggs or he had done with frying eggs when Dudley arrived in the kitchen? If he had done with frying eggs when Dudley arrived in the kitchen with his mother, why is the past perfect tense not used?