Repository navigation
[Executors] Run the UI tests of a class in a row between its class hooks - #134
Merged
Nice3point merged 7 commits intoOct 29, 2026
Merged
Conversation
Nice3point
marked this pull request as ready for review
October 29, 2026 17:52
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
What is this about:
The UI tests of a class run one after another, between the class hooks of that class.
Description:
What changed
[Before(Class)]of aRevitApiUiTestclass runs when the test host executes the first test of the class.A library
[BeforeEvery(Class)]hook with the lowest order and no timeout waits for that execution.The hooks of the class run after it with their own timeouts.
NotInParallelconstraint with one shared key instead ofRevitUiParallelLimit.TUnit runs keyed tests one at a time, class by class, in parallel with the other tests.
A key a test already declares joins the UI key in one constraint.
RevitApiTestandRevitApiUiTestdeclare[HookExecutor(typeof(...))].TUnit ignored the generic class attribute there.
The
[Before(Class)]and[After(Class)]hooks of a derived class ran outside the Revit thread: on a pool thread forRevitApiTest, in the test host process forRevitApiUiTest.--fail-fastcrashed the test host inTestScheduler.ProcessDynamicTestQueueAsync.Three UI classes, each opening a document in
[Before(Class)]and closing it in[After(Class)], on Revit 2027:[Before(Class)]hooks run before the first test, 3 documents openbefore A → A.* → after A → before B → …[Before(Class)]with[Timeout(3000)]times out behind the other hooks--maximum-parallel-tests 2,RevitApiTesttests wait for every UI testRevitApiTesttests run while Revit starts; the run takes 30 s, not 47 sWhere to look
RevitUiThreadExecutor.AddUiConstraintadds the UI key to the keys of theNotInParallelconstraint a test declares.TUnit reads only the first
NotInParallelconstraint of a test.With a second constraint, TUnit ignores either the UI key or the keys of the user.
The method does not change a global
[NotInParallel]: TUnit runs such a test alone at the end.[Before(Class)]hooks, as TUnit reports it outside Revit.How verified
Release.R21,Release.R24,Release.R27, zero warnings, zero errors.ClassHookTestsandClassHookUiTestsfail on Revit 2024 without the .NET Framework change, 2 of 2.FirstClassLifetimeUiTestsandSecondClassLifetimeUiTestsfail without the UI order change, 6 of 6 in two runs.--fail-fastwith a failing UI test.--fail-fastskips the 7 unstarted tests and runs no hook of the unreached classes.Open questions
RevitUiParallelLimitis public. No UI test uses it.The options: no change,
[Obsolete], or removal in a major version.Quality Checklist