(self)
| 303 | self.assertDictEqual({'test': 123}, cache_handler.read_cache()) |
| 304 | |
| 305 | def testWarmup_NotNeeded(self): |
| 306 | warmup_cache = TEST_WORKSPACE / 'test_cache.json' |
| 307 | mock.patch('run_perf.WARMUP_CACHE_FILE', warmup_cache).start() |
| 308 | mock.patch('psutil.boot_time', return_value=42).start() |
| 309 | mock.patch('time.time', return_value=123).start() |
| 310 | cache_handler = run_perf.CacheHandler(warmup_cache) |
| 311 | |
| 312 | # Test that the old entry is trimmed. |
| 313 | cache_handler.write_cache({'test': 87, 'some_old_entry': 23}) |
| 314 | self._WriteTestInput(V8_JSON) |
| 315 | |
| 316 | # One run only since no warm-up is required. |
| 317 | self._MockCommand(1 * ['.'], 1 * ['Richards: 1\nDeltaBlue: 2\n']) |
| 318 | self.assertEqual(0, self._CallMain('--checked-warmup')) |
| 319 | |
| 320 | # No warm-up ran, cache is only trimmed. |
| 321 | self.assertDictEqual({'test': 87}, cache_handler.read_cache()) |
| 322 | |
| 323 | def testWarmup_Needed(self): |
| 324 | warmup_cache = TEST_WORKSPACE / 'test_cache.json' |
nothing calls this directly
no test coverage detected