Порівняти коміти

...
1 Коміти
Автор SHA1 Повідомлення Дата
l0ng-ai fd2d916bfa test: fix five Windows-only test failures
- jdtls decompiled library class: the jdt handle uses the jar's portable
  path (forward slashes) as jdtls writes it on Windows.
- Plugin fuel budget: activation alone exceeded 6000 fuel on Windows. The
  budget is now 40000, and `patient` takes a per-step CPU workload so its
  whole run still exceeds the background budget without the refill.
- cpuprofile mapped sources: a Windows absolute path on Windows.
- Python member fallback: the saved command is the bare `python`, also on
  Windows.
- Checkout held by another worktree: compare with the path as git names it
  (no `\\?\` prefix).
2026-11-16 04:39:45 +08:00
8 змінених файлів з 23 додано та 12 видалено

No files matched your search

+6 -5
Переглянути файл
@@ -841,10 +841,11 @@ fn a_reporting_task_outlives_its_background_budget() {
#[test]
fn background_tasks_scale_and_renew_cpu_fuel_budget() {
// Room for activation (about 3_100 on macOS, more on Windows) but not for `patient`'s
// whole run (about 9_000) without the refill on each report.
// Room for activation (about 3_100 on macOS, more on Windows). A background task gets ten
// times it (5 s / 500 ms): enough for each step of `patient` with its CPU work (32_000 to
// 80_000), not for the whole run without the refill on each report.
let f = fixture(Limits {
fuel: 6_000,
fuel: 40_000,
timeout: Duration::from_millis(500),
background: Duration::from_millis(5_000),
..Limits::default()
@@ -856,11 +857,11 @@ fn background_tasks_scale_and_renew_cpu_fuel_budget() {
// Warm up activation in its own call so `patient` starts with a fresh budget.
assert_eq!(f.run("misbehave", "echo", Some("warm")).unwrap().as_deref(), Some("warm"));
let out = f.run("misbehave", "patient", None).expect("background task succeeds").expect("output");
let out = f.run("misbehave", "patient", Some("4000")).expect("background task succeeds").expect("output");
assert_eq!(out, "still here");
let err = f.run("misbehave", "spin", None).unwrap_err();
assert!(err.contains("exceeded its CPU budget (6000 fuel per call)"), "{err}");
assert!(err.contains("exceeded its CPU budget (40000 fuel per call)"), "{err}");
}
#[test]
+2 -1
Переглянути файл
@@ -2969,7 +2969,8 @@ async fn library_classes_without_sources_open_decompiled_by_a_running_jdtls() {
zip.write_all(b"\0").unwrap();
zip.finish().unwrap();
let class = format!("jar://{}!/acme/Thing.class", uri_of(&jar).trim_start_matches("file://"));
let escaped = jar.to_string_lossy().replace('/', "%5C/");
// jdtls writes the portable path (forward slashes on Windows too), each `/` escaped.
let escaped = jar.to_string_lossy().replace('\\', "/").replace('/', "%5C/");
let jdt = format!("jdt://contents/lib-1.0.jar/acme/Thing.class?=app/{escaped}%3Cacme%28Thing.class");
let decompiled =
"package acme;\n\npublic class Thing {\n public void run() {\n System.out.println();\n }\n}\n";
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
6e1d2ff774cc8088b4b8a6766914a7f752d05657634e6934503cebd2aa241fa2
9b5d0e40e7fef9e48e1a894549e4b96853b8217ad7d12fe29d238a599772a329
+6
Переглянути файл
@@ -180,8 +180,14 @@ impl commands::Guest for Misbehave {
env: Vec::new(),
};
let child = process::start(&cmd, None)?;
// CPU work per step (loop iterations), for fuel budget tests.
let work: u64 = arg.as_deref().and_then(|a| a.parse().ok()).unwrap_or(0);
for step in 0..25 {
task.report(step, Some(25), Some("waiting"));
let mut x: u64 = 0;
for _ in 0..work {
x = std::hint::black_box(x.wrapping_add(1));
}
// Waiting blocks in the host for 100 ms: wall time passes
// while the plugin itself is not running.
let _ = child.wait(100);
+4 -2
Переглянути файл
@@ -341,11 +341,13 @@ mod tests {
{"lineNumber":41,"columnNumber":21,"source":{"path":"localhost꞉5173/src/App.vue","sourceReference":7}}]},
{"locations":[{"lineNumber":10,"columnNumber":1,"source":{"path":"localhost꞉5173/","sourceReference":9}}]},
{"locations":[]}]}}"#;
let app = if cfg!(windows) { r"C:\work\shop\src\App.vue" } else { "/work/shop/src/App.vue" };
let json = json.replace("\"/work/shop/src/App.vue\"", &serde_json::to_string(app).unwrap());
let mut b = TreeBuilder::new();
add_cpuprofile(&mut b, json).unwrap();
add_cpuprofile(&mut b, &json).unwrap();
let p = b.finish("node", "samples", ProfileMode::Cpu);
let frame = |name: &str| p.frames.iter().find(|f| f.name == name).unwrap();
assert_eq!(frame("increment").file.as_deref(), Some(Path::new("/work/shop/src/App.vue")));
assert_eq!(frame("increment").file.as_deref(), Some(Path::new(app)));
assert_eq!(frame("increment").line, Some(12));
// No file on disk behind the frame: it stays without one.
assert_eq!((frame("inline").file.as_deref(), frame("inline").line), (None, None));
+1 -1
Переглянути файл
@@ -2573,7 +2573,7 @@ fn a_member_without_python_falls_back_to_the_primary_project_interpreter() {
assert_eq!(config.env["VIRTUAL_ENV"], outer.parent().unwrap().parent().unwrap().to_string_lossy());
// Saving strips what settings derived, so the fallback keeps following settings.
let stored = without_derived_in(&config, &bare, Some(&primary), &settings);
assert_eq!(stored.command, exe("python"));
assert_eq!(stored.command, "python", "the bare program, also on Windows");
assert!(!stored.env.contains_key("VIRTUAL_ENV"));
// The member's explicit interpreter wins over the primary project's venv —
+3 -2
Переглянути файл
@@ -1119,7 +1119,8 @@ fn checkout_of_a_branch_held_by_another_worktree_reports_it_and_changes_nothing(
fx.git(&["worktree", "add", "-q", "-b", "topic", linked.to_str().unwrap()]);
let repo = fx.repo();
let none = CheckoutOptions::default();
let linked_path = std::fs::canonicalize(&linked).unwrap();
// As git names it: no `\\?\` prefix on Windows.
let linked_path = dunce::canonicalize(&linked).unwrap();
// From the main worktree, the branch the linked worktree has checked out.
let outcome = repo.checkout_with("topic", false, &none).unwrap();
@@ -1139,7 +1140,7 @@ fn checkout_of_a_branch_held_by_another_worktree_reports_it_and_changes_nothing(
let linked_repo = Repo::discover(&linked).unwrap().unwrap();
linked_repo.set_execution_allowed(true);
let outcome = linked_repo.checkout_with("main", false, &none).unwrap();
let main_path = std::fs::canonicalize(&fx.dir).unwrap();
let main_path = dunce::canonicalize(&fx.dir).unwrap();
assert_eq!(outcome, CheckoutOutcome::CheckedOutInWorktree { branch: "main".into(), path: main_path });
assert_eq!(linked_repo.branch_info().unwrap().head.as_deref(), Some("topic"));