test artifacts clean up
Port of some helper functions for generate random buffers