North Korea conducted its longest-ever test flight of a ballistic missile Friday, sending an intermediate-range weapon hurtling over U.S. ally Japan into the northern Pacific Ocean in a launch that signals both defiance to its rivals and a big technological advance.