-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run typechecker tests in batches instead of one thread at a time
Summary: This diff implements batching for typechecker tests. A pet peeve of mine was the inefficiency in our typechecking testing framework, which has been exacerbated by the FFP's parsing regression. Instead of reparsing all of the builtins every time we run a typechecker test, we take in a list of files, parse all of the builtins *once*, and then typecheck each file separately in its own environment. In order to do this I had to do a few things: - AllErrors is no longer its own mode, but a special case of the "errors" mode - Support typechecking multiple files (previous diff) - Create a new "batch errors" mode for the typechecker which takes in a list of multiple files, and for each file, generates an ".out" file containing the test results - Make hh_show use a different out_channel so that hh_show doesn't necessarily print to stderr - Augment verify.py with a new batch mode that runs test cases in parallel. The structure before was: 1. verify.py created a 48 worker thread pool that ran each test case separately. Each test case would run hh_single_type_check <filename>. 2. hh_single_typecheck <filename> would return errors as output, and this output was put into .out files 3. verify.py would then check these out files and see if they were equal to the expected files. The structure now is: 1. verify.py will iterate through the directories provided for each test case, and for each directory, batch test cases by 100. 2. For every chunk of 100 tests, we can call hh_single_type_check --batch-mode <list of files> 3. Because files in the same directory are guaranteed to have the same flags, we can pass the same flags to hh_single_type_check as before 4. hh_single_type_check --batch-mode writes to filename.out directly for each file instead of printing all of the errors. 5. We then examine these .out files the same way we did before. We can probably extend this to do the same thing for our other tests, but this certainly makes it a lot easier for typechecking. Perf improvement: Previous typechecker tests would take up to 200 seconds on my devserver. **Now, it takes 6 seconds**. Reviewed By: vassilmladenov Differential Revision: D12812688 fbshipit-source-id: 5ba6fdd5c9a12e109a8290856aecc5d7681319d7
- Loading branch information
Showing
4 changed files
with
138 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters