mirror of
https://github.com/aphrody-labs/uutils-coreutils.git
synced 2026-10-17 12:45:53 +00:00
test: fix flaky test_chown_no_dereference_symlink_to_dir
On the Android emulator, the link's ctime did not change between its creation and `chown -h`, because the file system clock had not ticked. Sleep 100 ms before `chown`, as test_ls_order_time does. Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
This commit is contained in:
1 parent
db40b66b7f
commit
48b4093d63
1 file changed
+4
@@ -947,6 +947,10 @@ fn test_chown_no_dereference_symlink_to_dir() {
|
||||
let dir_meta_before = std::fs::metadata(at.plus("dir")).unwrap();
|
||||
let dir_ctime_before = (dir_meta_before.ctime(), dir_meta_before.ctime_nsec());
|
||||
|
||||
// Let the file system clock move past the link's ctime. On some systems,
|
||||
// such as the Android emulator, it advances in coarse steps.
|
||||
std::thread::sleep(std::time::Duration::from_millis(100));
|
||||
|
||||
scene
|
||||
.ucmd()
|
||||
.arg("--no-dereference")
|
||||
|
||||
Reference in new issue
Block a user