editor_tests: Fix for potential race loading editor languages (#35453)

Fix for potential race when loading HTML and JS languages (JS is
slower). Wait for both to load before continue tests.
Observed failure on linux:
[job](https://github.com/zed-industries/zed/actions/runs/16662438526/job/47162345259)
as part of https://github.com/zed-industries/zed/pull/35436

```
    thread 'editor_tests::test_autoclose_with_embedded_language' panicked at crates/editor/src/editor_tests.rs:8724:8:
    assertion failed: `(left == right)`: unexpected buffer text

    Diff < left / right > :
     <body><>
         <script>
    <        var x = 1;<>
    >        var x = 1;<
         </script>
     </body><>
```

Inserted `<` incorrect gets paired bracket inserted `>`.
I believe because the JS language injection hasn't fully loaded.

Release Notes:

- N/A
This commit is contained in:
Peter Tripp 2025-07-31 23:05:03 -04:00 committed by GitHub
parent 2315962e18
commit 76a8293cc6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8612,6 +8612,7 @@ async fn test_autoclose_with_embedded_language(cx: &mut TestAppContext) {
cx.language_registry().add(html_language.clone()); cx.language_registry().add(html_language.clone());
cx.language_registry().add(javascript_language.clone()); cx.language_registry().add(javascript_language.clone());
cx.executor().run_until_parked();
cx.update_buffer(|buffer, cx| { cx.update_buffer(|buffer, cx| {
buffer.set_language(Some(html_language), cx); buffer.set_language(Some(html_language), cx);