-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a dev drive for testing on Windows #15664
base: main
Are you sure you want to change the base?
Conversation
|
47662ec
to
322c5ab
Compare
Hm okay this gives a big speed-up but a test is failing
|
I think the small runner on the @MichaReiser would you be interested in investigating if this is a real bug with Dev Drives? I'm not sure if there are known issues with the file watcher? I'm happy to procure more logs if you tell me how. Or I can test a minimal snippet, if you can extract the core folder-watching behavior or point me to it? |
@@ -0,0 +1,62 @@ | |||
# Configures a drive for testing in CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scary, but just copied over from uv.
Glorious, here are the logs
|
(they don't seem helpful — not sure how to get more...) |
How dare you! I improved them a lot and I think there's some useful content in them. The specific test tests if the file watcher correctly handles the case where an entire directory gets deleted, specifically the
Now, we could fix the test to expect the events for one of the files instead of the directories, and I suspect it would then pass just fine on all platforms. However, this reveals a more fundamental problem with changing to dev drives: Windows's file-watching API returns different events depending on whether the path is a dev drive or not. Migrating to a dev drive would, therefore, remove the coverage for regular Windows drives, which I consider fairly important. That means I'm not sure if we should change our runner to use dev drivers. Is there a way to only use a dev drive for some directories, e.g., not the directory created by tempdir? |
RED_KNOT_LOG: debug | ||
RUST_LOG: debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be needed when you use testing::setup_tracing()
It always writes the logs and they should be visible if the test fails
} else { | ||
# The size (20 GB) is chosen empirically to be large enough for our | ||
# workflows; larger drives can take longer to set up. | ||
$Volume = New-VHD -Path C:/ruff_dev_drive.vhdx -SizeBytes 20GB | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably get away with a smaller drive for Ruff.
|
||
# Note we use `Get-PSDrive` is not sufficient because the drive letter is assigned. | ||
if (Test-Path "D:\") { | ||
Write-Output "Using existing drive at D:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A beautiful mix of space and tab indentation. hehe
Funny, I read
as: we expected these changes but did not observe them. Now I see — the message is much more helpful read that way. |
Yeah I agree coverage for a regular drive seems important. It sounds like it'd actually be important to get both coverage for a Dev Drive and the regular file system. I can own that.
Yeah, but then we'll probably miss out on the benefits. I can explore. |
That's fair. There's definetely still room for improvement. Ideally, the message would also say which event we expected. But it's much better than in the past where it just told you: Too bad, didn't work 😆 |
Thanks for taking a look Micha. I see this as relatively low priority, but I can explore it in my spare time, |
Thank you. Excluding the temp directory might be fine for Ruff. We don't write as many files as you do in uv. It's only a handful tests that make use of temp (although I don't know if cargo or other tools make heavy use of temp) |
I really misunderstood this in #15664 (comment)
Investigating the benefits of this here.
Requires Windows 2025, switching over in #15661