CommunityToolkit / CommunityToolkit/Tooling-Windows-Submodule

Tests time-out instead of failing when exceptions thrown during layout pass

Offen
#278 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug :bug: regression testing 🏗
Vorherrschende Sprache
C#
Sterne
56
Forks
19
Ø Merge
40 Min.
Gemergte PRs (30 T.)
1

Beschreibung

### Describe the bug

# Background

This was found while investigating [Fix: DockPanel measure fix #618](https://github.com/CommunityToolkit/Windows/pull/618)

# Problem

If an exception is thrown during a XAML measure pass, the tests stall out and do not report the answer.

This seems to happen whether using the `[UIThreadTestMethod]` attribute from our TestGen tooling or when using `[TestMethod]`, `EnqueueAsync`, `LoadTestContentAsync` and `UnloadTestContentAsync` piecemeal. The effect is the same.

# Solution

This needs investigation and fixing. It's not helpful to simply time out when a control throws during a layout or measure pass, and it can become an active problem if unexpected errors aren't being bubbled up to CI.

### Steps to reproduce

```text
This can be reproduced by throwing an exception during the `Measure` or `Arrange` pass while running in a unit test.

This can either be set up manually for a long-term repro, or it can be temporarily reintroduced by reverting https://github.com/CommunityToolkit/Windows/pull/618 and running.
```

### Expected behavior

Tests should catch exceptions thrown during XAML layout and bubble them up instead of timing out.

### Screenshots

_No response_

### Code Platform

- [ ] UWP
- [ ] WinAppSDK / WinUI 3
- [ ] Web Assembly (WASM)
- [ ] Android
- [ ] iOS
- [ ] MacOS
- [ ] Linux / GTK

### Windows Build Number

- [ ] Windows 10 1809 (Build 17763)
- [ ] Windows 10 1903 (Build 18362)
- [ ] Windows 10 1909 (Build 18363)
- [ ] Windows 10 2004 (Build 19041)
- [ ] Windows 10 20H2 (Build 19042)
- [ ] Windows 10 21H1 (Build 19043)
- [ ] Windows 11 21H2 (Build 22000)
- [ ] Other (specify)

### Other Windows Build number

_No response_

### App minimum and target SDK version

- [ ] Windows 10, version 1809 (Build 17763)
- [ ] Windows 10, version 1903 (Build 18362)
- [ ] Windows 10, version 1909 (Build 18363)
- [ ] Windows 10, version 2004 (Build 19041)
- [ ] Other (specify)

### Other SDK version

_No response_

### Visual Studio Version

_No response_

### Visual Studio Build Number

_No response_

### Device form factor

_No response_

### Additional context

_No response_

### Help us help you

Yes, I'd like to be assigned to work on this item.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, den Fehler mit einer Ausnahme während Measure oder Arrange zu reproduzieren, indem du entweder UIThreadTestMethod oder die Abfolge aus TestMethod, EnqueueAsync, LoadTestContentAsync und UnloadTestContentAsync verwendest. Vergleiche das Verhalten nach dem Zurücksetzen von Fix: DockPanel measure fix #618. Die Aufgabe ist erledigt, wenn Layout-Ausnahmen von den Tests abgefangen und gemeldet werden, statt einen Timeout zu verursachen, und eine Regressionstestabdeckung für den fehlschlagenden Pfad vorhanden ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
testing-qa
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.