MCPcopy Index your code
hub / github.com/nodejs/node / testWarmup_NotNeeded

Method testWarmup_NotNeeded

deps/v8/tools/unittests/run_perf_test.py:305–321  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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'

Callers

nothing calls this directly

Calls 6

write_cacheMethod · 0.95
_WriteTestInputMethod · 0.95
_MockCommandMethod · 0.95
_CallMainMethod · 0.95
read_cacheMethod · 0.95
startMethod · 0.45

Tested by

no test coverage detected