-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Summary
Our function testutil_copy_data_opt (currently used only in timestamp_abort) creates a copy of the test's data directory with the SAVE extension similarly to testutil_copy_data, except that it creates hard links for files that we expect to not be modified. This helps to improve latency and space utilization of the tests, such as when a lot of data copying is involved due to testing backups.
The function uses cp -rp -l to create hard links for files in the source directory, which works on Linux. On macOS, it still produces the correct result, but it also prints "Bad file descriptor" to the standard error. The command still returns 0, signifying correct execution.
Diagnosis
We believe that this is a bug in the macOS's implementation of cp, which can be quickly confirmed by running the following steps on an empty directory:
M-W04P92XGQR: ~/Test peter.macko % touch x M-W04P92XGQR: ~/Test peter.macko % cp -l x y cp: y: Bad file descriptor M-W04P92XGQR: ~/Test peter.macko % ls -alh total 0 drwxr-xr-x 4 peter.macko staff 128 Apr 12 14:23 . drwxr-x---+ 60 peter.macko staff 1.9K Apr 12 14:21 .. -rw-r--r-- 2 peter.macko staff 0 Apr 12 14:23 x -rw-r--r-- 2 peter.macko staff 0 Apr 12 14:23 y
- duplicates
-
WT-10992 Implement testutil functions for directory copy and remove
- Closed