1'use strict'; 2 3require('../common'); 4const assert = require('assert'); 5const { spawnSync } = require('child_process'); 6 7const results = new Set(); 8for (let i = 0; i < 10; i++) { 9 const result = spawnSync(process.execPath, ['-p', 'Math.random()']); 10 assert.strictEqual(result.status, 0); 11 results.add(result.stdout.toString()); 12} 13// It's theoretically possible if _very_ unlikely to see some duplicates. 14// Therefore, don't expect that the size of the set is exactly 10 but do 15// assume it's > 1 because if you get 10 duplicates in a row you should 16// go out real quick and buy some lottery tickets, you lucky devil you! 17assert(results.size > 1); 18