| ... | @@ -741,11 +741,6 @@ test "open file with exclusive lock twice, make sure it waits" { | ... | @@ -741,11 +741,6 @@ test "open file with exclusive lock twice, make sure it waits" { |
| 741 | return error.SkipZigTest; | 741 | return error.SkipZigTest; |
| 742 | } | 742 | } |
| 743 | | 743 | |
| 744 | if (std.Target.current.os.tag == .windows) { | | |
| 745 | // https://github.com/ziglang/zig/issues/7010 | | |
| 746 | return error.SkipZigTest; | | |
| 747 | } | | |
| 748 | | | |
| 749 | const filename = "file_lock_test.txt"; | 744 | const filename = "file_lock_test.txt"; |
| 750 | | 745 | |
| 751 | var tmp = tmpDir(.{}); | 746 | var tmp = tmpDir(.{}); |
| ... | @@ -770,13 +765,17 @@ test "open file with exclusive lock twice, make sure it waits" { | ... | @@ -770,13 +765,17 @@ test "open file with exclusive lock twice, make sure it waits" { |
| 770 | defer t.wait(); | 765 | defer t.wait(); |
| 771 | | 766 | |
| 772 | const SLEEP_TIMEOUT_NS = 10 * std.time.ns_per_ms; | 767 | const SLEEP_TIMEOUT_NS = 10 * std.time.ns_per_ms; |
| 773 | | 768 | // Make sure we've slept enough. |
| 774 | std.time.sleep(SLEEP_TIMEOUT_NS); | 769 | var timer = try std.time.Timer.start(); |
| | 770 | while (true) { |
| | 771 | std.time.sleep(SLEEP_TIMEOUT_NS); |
| | 772 | if (timer.read() >= SLEEP_TIMEOUT_NS) break; |
| | 773 | } |
| 775 | // Check that createFile is still waiting for the lock to be released. | 774 | // Check that createFile is still waiting for the lock to be released. |
| 776 | testing.expect(!evt.isSet()); | 775 | testing.expect(!evt.isSet()); |
| 777 | file.close(); | 776 | file.close(); |
| 778 | // Generous timeout to avoid failures on heavily loaded systems. | 777 | // No timeout to avoid failures on heavily loaded systems. |
| 779 | try evt.timedWait(SLEEP_TIMEOUT_NS); | 778 | evt.wait(); |
| 780 | } | 779 | } |
| 781 | | 780 | |
| 782 | test "open file with exclusive nonblocking lock twice (absolute paths)" { | 781 | test "open file with exclusive nonblocking lock twice (absolute paths)" { |