Add test for random module that checks platform in order to pass test and avoid issues in #5999