(results)
| 35 | } |
| 36 | |
| 37 | function validateResults(results) { |
| 38 | // This test should have checked that the CPU usage of each thread is greater |
| 39 | // than the previous one, while the process one was not. |
| 40 | // Unfortunately, the real values are not really predictable on the CI so we |
| 41 | // just check that all the values are positive numbers. |
| 42 | for (let i = 0; i < 3; i++) { |
| 43 | assert.ok(typeof results[i].process.user === 'number'); |
| 44 | assert.ok(results[i].process.user >= 0); |
| 45 | |
| 46 | assert.ok(typeof results[i].process.system === 'number'); |
| 47 | assert.ok(results[i].process.system >= 0); |
| 48 | |
| 49 | assert.ok(typeof results[i].thread.user === 'number'); |
| 50 | assert.ok(results[i].thread.user >= 0); |
| 51 | |
| 52 | assert.ok(typeof results[i].thread.system === 'number'); |
| 53 | assert.ok(results[i].thread.system >= 0); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | // The main thread will spawn three more threads, then after a while it will ask all of them to |
| 58 | // report the thread CPU usage and exit. |
no test coverage detected
searching dependent graphs…