Repository navigation
Commit d58af6a
committed
test(webview): await the on-demand locale fetch instead of timing it
platform-unit-test (windows-latest) job 126079240255 failed on the warm-switch
case: expected `Une erreur s'est produite`, received `Etwas ist schiefgelaufen`
with `active-language` still `de`, i.e. the french fetch had not resolved rather
than resolving wrong.
The locale-loading suite asserted that a switch to a non-fallback locale lands
inside `waitFor`'s fixed 1000 ms window. That switch is an on-demand import() of
the locale's bundles, so its duration is a property of the machine and the load
on it, not of the code under test: the ubuntu lane finished the fetch inside the
window and the windows lane did not, which is why the same suite was green on one
required check and red on the other.
The assertion now awaits the memoized `loadLanguage` promise the provider itself
waits on - the idiom the unmount case at the end of this file already uses - so it
has no deadline. `waitFor` still covers the render that `languageChanged`
triggers, which is microtask-bound rather than disk-bound.
Control: forcing every lazy locale module load to take 1500 ms reproduces the
runner failure exactly on the previous test - 4 failures at lines 51, 71, 88 and
127, the four `waitFor` sites, with `Something went wrong` and
`Etwas ist schiefgelaufen` as the received text - while the updated suite stays
green under the same harness and under a 3000 ms delay with CI settings
(testTimeout 15000, maxWorkers 1). The harness was reverted byte-identically; no
test was skipped and nothing was suppressed.1 parent fda1600 commit d58af6a
1 file changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
50 | 59 | | |
51 | 60 | | |
52 | 61 | | |
| |||
67 | 76 | | |
68 | 77 | | |
69 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
70 | 82 | | |
71 | 83 | | |
72 | 84 | | |
| |||
84 | 96 | | |
85 | 97 | | |
86 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
87 | 102 | | |
88 | 103 | | |
89 | 104 | | |
| |||
105 | 120 | | |
106 | 121 | | |
107 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
108 | 126 | | |
109 | 127 | | |
110 | 128 | | |
| |||
123 | 141 | | |
124 | 142 | | |
125 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
126 | 148 | | |
127 | 149 | | |
128 | 150 | | |
| |||
0 commit comments