[PR #3088] [MERGED] Tests: read the session lock after releasing it #4796

Closed
opened 2026-11-03 05:08:02 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3088
Author: @Domanffe
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: test/session-lock-reads-after-release


📝 Commits (2)

  • 1743bbc Tests: read the session lock after releasing it
  • 9d9e1a9 rustfmt

📊 Changes

1 file changed (+3 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/save.rs (+3 -1)

📄 Description

🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself.

session_lock_is_exclusive opened session.lock with std::fs::read while
the lock was still held by first. Windows takes an exclusive LockFileEx
region literally: another handle cannot read it, so the test died with
Os { code: 33, ... "part of this file is locked by another process" } before
checking the second acquire. The exclusivity assertion itself passed.

The read now happens after drop(first), which leaves the test checking the
same three things in the same order: the first acquire succeeds, a second one
fails while it is held, and the file holds vanilla's 26 03 bytes.

Evidence, Windows 11:

  • before, on origin/main: cargo test -p horizon-client --lib save::tests::session_lock_is_exclusive → panicked at save.rs:4443:53: ... Os { code: 33 ... }, test result: FAILED;
  • after, on this commit: cargo test -p horizon-client --lib save::tests::session_lock -- --test-threads=1 → 2 passed; 0 failed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3088 **Author:** [@Domanffe](https://github.com/Domanffe) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `test/session-lock-reads-after-release` --- ### 📝 Commits (2) - [`1743bbc`](https://github.com/horizon-rust/horizon/commit/1743bbc5250424c2a625f2657f10d84249362d92) Tests: read the session lock after releasing it - [`9d9e1a9`](https://github.com/horizon-rust/horizon/commit/9d9e1a97a8c38187ea93458f3e4763589a2c347e) rustfmt ### 📊 Changes **1 file changed** (+3 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/save.rs` (+3 -1) </details> ### 📄 Description > 🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself. `session_lock_is_exclusive` opened `session.lock` with `std::fs::read` while the lock was still held by `first`. Windows takes an exclusive `LockFileEx` region literally: another handle cannot read it, so the test died with `Os { code: 33, ... "part of this file is locked by another process" }` before checking the second acquire. The exclusivity assertion itself passed. The read now happens after `drop(first)`, which leaves the test checking the same three things in the same order: the first acquire succeeds, a second one fails while it is held, and the file holds vanilla's `26 03` bytes. Evidence, Windows 11: - before, on `origin/main`: `cargo test -p horizon-client --lib save::tests::session_lock_is_exclusive` → `panicked at save.rs:4443:53: ... Os { code: 33 ... }`, `test result: FAILED`; - after, on this commit: `cargo test -p horizon-client --lib save::tests::session_lock -- --test-threads=1` → `2 passed; 0 failed`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:08:02 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4796
No description provided.