Nathan Sobo
a51585d2da
Fix race condition in test_collaborating_with_completion ( #44806 )
...
The test `test_collaborating_with_completion` has a latent race
condition that hasn't manifested on CI yet but could cause hangs with
certain task orderings.
## The Bug
Commit `fd1494c31a` set up LSP request handlers AFTER typing the trigger
character:
```rust
// Type trigger first - spawns async tasks to send completion request
editor_b.update_in(cx_b, |editor, window, cx| {
editor.handle_input(".", window, cx);
});
// THEN set up handlers (race condition!)
fake_language_server
.set_request_handler::<lsp::request::Completion, _, _>(...)
.next().await.unwrap(); // Waits for handler to receive a request
```
Whether this works depends on task scheduling order, which varies by
seed. If the completion request is processed before the handler is
registered, the request goes to `on_unhandled_notification` which claims
to handle it but sends no response, causing a hang.
## Changes
- Move handler setup BEFORE typing the trigger character
- Make `TestDispatcher::spawn_realtime` panic to prevent future
non-determinism from real OS threads
- Add `execution_hash()` and `execution_count()` to TestDispatcher for
debugging
- Add `DEBUG_SCHEDULER=1` logging for task execution tracing
- Document the investigation in `situation.md`
cc @localcc @SomeoneToIgnore (authors of related commits)
Release Notes:
- N/A
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev >
2025-12-14 21:58:26 +02:00
..
2025-12-10 16:48:08 +00:00
2025-11-26 18:03:42 +01:00
2025-12-10 16:48:08 +00:00
2025-11-24 13:34:04 +01:00
2025-12-10 16:48:08 +00:00
2025-12-12 11:06:49 +00:00
2025-12-14 03:22:20 +00:00
2025-12-14 10:48:23 -03:00
2025-10-20 08:35:28 -03:00
2025-12-14 03:22:20 +00:00
2025-11-28 08:18:19 +01:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-01 12:57:51 +00:00
2025-12-05 19:53:53 +01:00
2025-11-07 22:27:14 +00:00
2025-11-27 14:08:43 +00:00
2025-11-11 12:55:19 +00:00
2025-11-27 13:46:43 +00:00
2025-10-17 18:58:14 +00:00
2025-12-04 12:14:31 +01:00
2025-11-20 12:18:50 +01:00
2025-12-01 22:36:30 -05:00
2025-12-02 16:27:36 +00:00
2025-11-24 13:34:04 +01:00
2025-12-10 00:42:19 +00:00
2025-12-10 17:36:51 -08:00
2025-11-06 09:16:45 +00:00
2025-11-10 23:00:55 -07:00
2025-10-17 18:58:14 +00:00
2025-12-13 00:56:06 +00:00
2025-12-04 15:56:57 -08:00
2025-12-14 21:58:26 +02:00
2025-12-08 22:03:51 +00:00
2025-10-17 18:58:14 +00:00
2025-12-10 07:07:48 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-12 11:06:49 +00:00
2025-12-13 11:06:30 -05:00
2025-12-02 16:15:18 -05:00
2025-10-17 18:58:14 +00:00
2025-11-19 12:34:41 +01:00
2025-12-08 19:57:02 +01:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-04 03:55:04 +05:30
2025-12-09 09:08:59 +01:00
2025-12-09 20:54:16 +01:00
2025-10-17 18:58:14 +00:00
2025-12-11 17:23:27 +00:00
2025-10-23 14:13:35 -04:00
2025-12-13 11:06:30 -05:00
2025-12-12 21:18:13 +00:00
2025-12-10 17:36:51 -08:00
2025-12-09 15:13:52 +00:00
2025-12-13 11:06:30 -05:00
2025-12-14 19:21:50 +01:00
2025-12-11 22:30:51 +00:00
2025-12-03 20:32:25 +00:00
2025-10-17 18:58:14 +00:00
2025-12-08 21:49:26 +01:00
2025-12-02 22:26:40 +00:00
2025-12-08 21:49:26 +01:00
2025-12-08 21:49:26 +01:00
2025-12-08 13:16:19 +00:00
2025-12-14 03:22:20 +00:00
2025-10-17 18:58:14 +00:00
2025-11-26 16:56:34 +00:00
2025-10-17 18:58:14 +00:00
2025-12-12 14:28:25 +01:00
2025-10-20 10:30:06 +00:00
2025-11-20 22:17:50 -07:00
2025-12-08 19:50:20 +01:00
2025-12-12 14:28:25 +01:00
2025-12-08 13:32:14 -05:00
2025-12-14 12:55:19 +00:00
2025-11-19 22:00:58 +00:00
2025-11-28 15:48:33 -05:00
2025-12-14 11:47:15 -07:00
2025-11-17 12:31:00 +00:00
2025-10-26 13:24:26 +00:00
2025-10-17 18:58:14 +00:00
2025-12-09 09:29:40 -08:00
2025-10-17 18:58:14 +00:00
2025-12-10 12:10:43 -08:00
2025-12-11 19:14:36 +00:00
2025-12-02 21:33:41 +00:00
2025-10-17 18:58:14 +00:00
2025-11-19 22:00:58 +00:00
2025-12-05 20:26:42 +00:00
2025-12-02 21:33:41 +00:00
2025-12-12 14:15:50 +01:00
2025-12-09 13:22:57 +01:00
2025-12-14 03:22:20 +00:00
2025-12-14 03:22:20 +00:00
2025-10-17 18:58:14 +00:00
2025-10-22 19:52:38 +00:00
2025-12-04 03:55:04 +05:30
2025-12-13 01:38:44 +01:00
2025-10-22 19:52:38 +00:00
2025-10-17 18:58:14 +00:00
2025-12-09 09:08:59 +01:00
2025-10-17 18:58:14 +00:00
2025-12-12 11:16:17 +00:00
2025-12-08 14:04:49 +00:00
2025-12-12 09:55:06 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-03 21:56:39 +00:00
2025-11-26 18:03:42 +01:00
2025-10-17 18:58:14 +00:00
2025-12-11 22:29:47 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-10 12:10:43 -08:00
2025-10-20 17:20:09 +00:00
2025-11-11 16:10:47 +01:00
2025-12-01 20:52:57 -07:00
2025-12-11 15:49:10 -05:00
2025-11-24 13:24:26 -05:00
2025-12-06 18:49:21 +00:00
2025-12-08 21:00:00 +05:30
2025-10-17 18:58:14 +00:00
2025-12-10 12:10:43 -08:00
2025-12-10 07:07:48 +00:00
2025-12-12 11:16:17 +00:00
2025-12-12 14:28:25 +01:00
2025-11-13 14:56:40 +01:00
2025-12-10 18:00:11 +00:00
2025-12-03 21:56:39 +00:00
2025-12-14 03:22:20 +00:00
2025-12-10 18:07:01 -05:00
2025-12-10 12:10:43 -08:00
2025-10-17 18:58:14 +00:00
2025-11-27 13:46:43 +00:00
2025-12-12 11:53:15 +00:00
2025-12-11 21:05:50 +00:00
2025-12-12 06:32:30 -08:00
2025-12-09 09:29:40 -08:00
2025-11-03 19:25:15 +00:00
2025-12-05 17:23:06 +00:00
2025-12-04 14:42:26 +00:00
2025-12-01 18:55:33 +01:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-11 22:29:47 +00:00
2025-12-01 09:12:31 +01:00
2025-12-14 03:22:20 +00:00
2025-10-27 10:13:26 -04:00
2025-11-21 08:28:17 -07:00
2025-11-07 22:27:14 +00:00
2025-12-13 11:06:30 -05:00
2025-10-17 18:58:14 +00:00
2025-12-08 21:38:24 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-20 01:52:13 -03:00
2025-11-03 19:25:15 +00:00
2025-12-05 17:23:06 +00:00
2025-12-04 15:56:57 -08:00
2025-10-17 18:58:14 +00:00
2025-11-20 12:18:50 +01:00
2025-11-24 13:34:04 +01:00
2025-12-03 22:49:44 +00:00
2025-12-04 15:37:32 -05:00
2025-12-09 09:08:59 +01:00
2025-11-07 11:36:05 +00:00
2025-11-24 13:34:04 +01:00
2025-12-11 22:40:48 -07:00
2025-12-12 11:06:49 +00:00
2025-12-12 14:28:25 +01:00
2025-12-04 03:55:04 +05:30
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-01 20:52:57 -07:00
2025-10-17 18:58:14 +00:00
2025-12-14 02:51:58 +00:00
2025-12-09 21:37:39 +01:00
2025-12-13 11:06:30 -05:00
2025-11-22 23:28:34 -03:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-12 13:33:49 +01:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-11 22:18:38 +00:00
2025-11-07 22:27:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-13 11:06:30 -05:00
2025-12-12 06:32:30 -08:00
2025-11-07 22:27:14 +00:00
2025-12-08 16:38:34 +01:00
2025-12-11 22:29:47 +00:00
2025-12-10 12:10:43 -08:00
2025-12-13 11:06:30 -05:00
2025-12-10 17:36:51 -08:00
2025-12-06 17:56:49 +00:00
2025-11-07 22:27:14 +00:00
2025-12-11 22:29:47 +00:00
2025-12-05 17:23:06 +00:00