use JSON.serialize in command to sidestep issues with $ts conversion
add a sort order to single pipeline test to avoid non-deterministic result sorting.