"vscode:/vscode.git/clone" did not exist on "ab754c8cfb66b7ff3e1ba9f605f751666ed1675e"
test_startup_time.py 715 Bytes
Newer Older
facebook-github-bot's avatar
facebook-github-bot committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved


import unittest

from d2go.initializer import (
    REGISTER_D2_DATASETS_TIME,
    REGISTER_TIME,
    SETUP_ENV_TIME,
)


class TestStartupTime(unittest.TestCase):
    @unittest.skipIf(True, "Will exceed threshold")
    def test_setup_env_time(self):
        self.assertLess(sum(SETUP_ENV_TIME), 5.0)

    def test_register_d2_datasets_time(self):
        self.assertLess(sum(REGISTER_D2_DATASETS_TIME), 3.0)

    @unittest.skipIf(True, "Will exceed threshold")
    def test_register_time(self):
        # NOTE: _register is should be done quickly, currently about 0.2s
        self.assertLess(sum(REGISTER_TIME), 1.0)