-
Notifications
You must be signed in to change notification settings - Fork 14
Parallel make check #865
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
Parallel make check #865
Conversation
Something is not working nicely in the windows build:
(this is a different failure from the expected one). The linux builds all error out properly:
I would like to point out that the functionality in here does not replace the one provided by |
b96fc42
to
5572e7c
Compare
Currently unit tests can not be run in parallel. This prevents us from speeding up ci builds (see bitcoin/bitcoin#12926, #865) and won't work with the updated build definitions from bitcoin 0.17 (#860). This is a regression which was introduced in #793. This pull request fixes #861. The problem is that the `StateDB` component does something actively when being initialized (not something a component should do), which is to access disk and so on, which can fail. Since there is a `UnitEInjector` for every `BasicTestingSetup` running the unit tests in parallel creates a database _in the same directory_ per unit tests suite which clashes and breaks and throws and aborts and dies. This can be prevented by using an in-memory database, but the problem shifts: How to get that configuration in? I did not want to expose this as a user-definable setting and also not as a chain parameter, so these two configuration options are not available. Which is why I created `UnitEInjectorConfiguration`. This is something which should not be necessary as usually you would not expose the same module as in production in unit tests but use a subset or just the mocked version, but since the rest of bitcoin is not in well-defined components and accesses them using `GetComponent` a global injector has to be available in some tests. The change ultimately does not affect the prod version of things, but the tests, which inject a different `UnitEInjectorConfiguration`. I made this a `struct` rather then just a flag `unit_tests` such that it is extensible in case we have other cases like this. In order to make the injector be able to access fields from it's own instance in the definition of a component I altered the definition of `UNMANAGED_COMPONENT` a bit. I would like to point out that these initialization issues would also have happened with an Application class (#723), as that is exactly what `UnitEInjector` is, just you would inject things manually. Signed-off-by: Julian Fleischer <julian@thirdhash.com>
Signed-off-by: Julian Fleischer <julian@thirdhash.com>
Signed-off-by: Julian Fleischer <julian@thirdhash.com>
Signed-off-by: Julian Fleischer <julian@thirdhash.com>
Signed-off-by: Julian Fleischer <julian@thirdhash.com>
1a90464
to
ab8fa35
Compare
Rebased with the change from #870 which should allow the CI build to pass, give us parallel unit tests, and decrease ci run times :-) |
@castarco @Gnappuraz I answered your comments/questions. What do you otherwise think about this change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK ab8fa35
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides two missed files, utACK 7651432
Signed-off-by: Julian Fleischer <julian@thirdhash.com>
This is a backport of bitcoin/bitcoin#12926, which unveils how master is currently broken as reported in #861
Here is the original description:
For bitcoin this improved in quite a nice speedup for builds (especially the Win32 unit test only one):