NXP-14374: indent, clean
NXP-14678: fix randomness by not assuming on number of pending docs, just count the number of command processed