-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SubmoduleStatusProviderTests
extremely slow
#8279
Comments
Run all tests does not work anymore. It builds everything and does not run any test. The SubmoduleStatusProviderTests took 6.6 minutes, too, with high CPU load by the anti-virus virus. I cannot turn it off on this machine. |
My stuff is run on a VM in Parallels, the way I always had it. No AV other
than the standard Windows Defender.
Since I refactored the build infra, I always run builds and tests from a
cli.
I just started running them again in a VS porting to .NET Core.
I'm going to check the master for issues running tests from a VS.
|
I can do a profiling pass to see what's taking time here. |
So the general approach to use here leverages two things:
Realistically you should be able to shave about 70% off the test time by avoiding some calls to git for all tests except the first. |
What about extracting zipped repo to temp folder to have it at a known
state. Then do things to the repo. Could also use a bundle. Add a remote to
the extracted bundle. Then just code the reset to do a reset and maybe
clean of working directory to a specific sha. Could even store different
sha's for different initial states.
|
I'm opposed to extracting a zipped repo if it can be avoided any other way. Such a repository would not be reviewable if we need to make any changes to its form. The |
Why I also suggested a bundle. https://git-scm.com/docs/git-bundle
|
😕 I don't understand how a bundle improves the ability to review changes. Isn't it still a binary file? |
It's a repo. You can add a remote to it. Fetch from it, clone it, compare
branches.....
|
Basically, we have a test setup process before tests run that generates or
copies the bundle to artifacts folder. Then each test that needs initial
repo state can either clone from bundle into testrepos\test name or id\ or
initial setup clones from bundle once and setup for each test resets repo
to x Sha. The bundle is your initial repo with initial state. It could
have initial work at a known state. Then each test can test against the
results of doing x action to local repo. This would allow us to do
whatever to the local repo and always reset to origin\initial for example.
|
Whatever process we chose it has to be immune to concurrent access and race conditions as tests often run in parallel. |
xunit doesn't run tests in the same class in parallel. Does nunit? |
I don't think so. |
The solution to improve the tests I can see is a hack to check that [SetUp] only executes once for a fixture. GE uses BeforeTest to setup the thread handling etc, but OneTimeSetup runs before that.
Seem to be possible, even if we have not set that up. For #8334 trying to improve the tests, I tried to setup according to Parallel class with non-parallel methods in NUnit documentation |
Parallel test execution is no option ATM. There are too many singletons, e.g. |
i looked at this problem last night, and a had a partial success. about
half of tests failed because they expected a clean state.
we need to reset submodules to first commit. I need help with that.
|
@RussKie see the PR for a solution For parallel: I just tried to setup the attributes correctly if parallel is enabled |
Current behaviour
Running tests under VS I've observed
![image](https://user-images.githubusercontent.com/4403806/85961060-19d40580-b9eb-11ea-8dc6-10624b92bbff.png)
SubmoduleStatusProviderTests
tests to take in excess of 7 minutes to complete.Expected behaviour
Tests must complete faster.
The text was updated successfully, but these errors were encountered: