Repository navigation
Commit 21fb115
authored
test(wpf): stop the TransitioningContentControl tests waiting on WPF's render loop (#4499)
## Summary
**The `TransitioningContentControl` tests no longer wait on WPF's render
loop, so they cannot time out on a busy runner.**
- **`CompletingTransition_Completes_AbortsTransitionAndRaisesCompleted`
signals completion directly.** It calls the control's completion handler
with the storyboard's clock instead of starting the storyboard and
pumping the dispatcher until WPF ticks it.
- **The double-completion regression test does the same.**
`OnTransitionCompleted_RepeatedForSameClock_RaisesTransitionCompletedOnce`
runs a real content change, signals completion twice with the same clock
as WPF does, then runs a second transition, and expects started,
completed, started, completed.
## Why
**The test failed intermittently in CI, blocking unrelated PRs.**
- It waited for WPF's render loop to tick the animation clock. On a busy
runner the loop can stall, and the test failed after its full 10 second
wait with `completed == false` while other runs of the same test passed
in under a second.
## Breaking changes
**None.**
- `TransitioningContentControl.OnTransitionCompleted` becomes `internal`
(was `private`) so the tests can signal completion, matching the other
internal members the tests already use.
## How this was verified
**The test class and the whole WPF test project were run repeatedly on
real Windows across net8, net9 and net10 with no failures; the
regression test still fails with the once-per-transition guard
removed.**
## Notes for the reviewer
**The control's logic is unchanged; the change is in how the tests drive
completion.**
- No test in `ReactiveUI.Wpf.Tests` waits on an animation clock any
more.
- Trade-off: no test now proves that the control subscribes its handler
to the storyboard's `Completed` event, since that needs WPF to tick the
clock.
## Checklist
- [x] I have read the [Contribute
guide](https://www.reactiveui.net/contribute/index.html)
- [x] The PR title follows [Conventional
Commits](https://www.conventionalcommits.org/)
- [x] Tests cover this change, or the summary says why they do not
- [x] New or changed public API has XML documentation1 parent 76926d8 commit 21fb115
2 files changed
Lines changed: 47 additions & 74 deletions
Lines changed: 23 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
665 | 665 | | |
666 | 666 | | |
667 | 667 | | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
668 | 691 | | |
669 | 692 | | |
670 | 693 | | |
| |||
701 | 724 | | |
702 | 725 | | |
703 | 726 | | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | 727 | | |
727 | 728 | | |
728 | 729 | | |
| |||
Lines changed: 24 additions & 52 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | 69 | | |
76 | 70 | | |
77 | 71 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | 72 | | |
82 | 73 | | |
83 | 74 | | |
| |||
960 | 951 | | |
961 | 952 | | |
962 | 953 | | |
963 | | - | |
964 | | - | |
| 954 | + | |
| 955 | + | |
965 | 956 | | |
966 | 957 | | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
967 | 963 | | |
968 | 964 | | |
969 | 965 | | |
| |||
973 | 969 | | |
974 | 970 | | |
975 | 971 | | |
976 | | - | |
977 | 972 | | |
978 | 973 | | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | | - | |
986 | | - | |
987 | | - | |
| 974 | + | |
| 975 | + | |
988 | 976 | | |
989 | 977 | | |
990 | 978 | | |
991 | 979 | | |
992 | | - | |
993 | 980 | | |
994 | 981 | | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
| 982 | + | |
1005 | 983 | | |
1006 | 984 | | |
1007 | 985 | | |
1008 | 986 | | |
1009 | 987 | | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
1014 | 991 | | |
1015 | 992 | | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
1016 | 997 | | |
1017 | | - | |
| 998 | + | |
1018 | 999 | | |
1019 | 1000 | | |
1020 | 1001 | | |
| |||
1026 | 1007 | | |
1027 | 1008 | | |
1028 | 1009 | | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
1029 | 1013 | | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
| 1014 | + | |
| 1015 | + | |
1044 | 1016 | | |
1045 | | - | |
| 1017 | + | |
1046 | 1018 | | |
1047 | 1019 | | |
1048 | 1020 | | |
| |||
0 commit comments