summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorAlex Dowad <alexinbeijing@gmail.com>2020-05-10 14:57:12 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-05-11 10:22:42 +0200
commit1e3196a159583baf93e049ca87f98fb9e56097e2 (patch)
tree4503c5fd2f0a04958d7d45c330f76a6bf1e983bc /build
parent80b500619651901342c50b99bbd9e20715d390a9 (diff)
downloadphp-git-1e3196a159583baf93e049ca87f98fb9e56097e2.tar.gz
Don't check directory atime in lstat_stat_variation10.phpt test
This is a funny one. I discovered that lstat_stat_variation10.phpt was failing every now and again when the PHP test suite was run on my dev PC. The output from the failing test showed that the atime (access time) of the directory created in the test was changing between these lines: $old_stat = stat($dirname); clearstatcache(); sleep(1); var_dump( is_dir($dirname) ); $new_stat = stat($dirname); Could is_dir() be accessing the directory and changing the atime? strace showed that is_dir was only issuing a single stat() syscall. Could stat() change the atime? No, no, that would just be perverse. Nobody would be stupid enough to implement the kernel in that way. Checked the kernel source, found that the function called when atime needs to be updated appears to be touch_atime(). Broke out the BCC kernel tracing tools and ran this one while running the flaky test case in a loop: sudo trace -I<kernel src dir>/include/linux/path.h -I<same>/include/linux/dcache.h 'touch_atime(struct path *path) "%s", path->dentry->d_name.name' Inspecting the results showed that something called "git_thread" was occcasionally updating the atime on the directory in question!! What on earth...??? The PID shown by trace revealed that this was a background thread for Sublime Text 3. Sublime now has git integration and shows when there are untracked or modified files. It seems that it uses a background thread to regularly scan the project directory and look for new and modified files. This was causing the atime to change. Even though other developers may not be running ST3, there are any number of reasons why a background process might recurse through various directories and could cause the atime to change unexpectedly. Therefore, update the test case so it doesn't fail in such cases. Closes GH-5553.
Diffstat (limited to 'build')
0 files changed, 0 insertions, 0 deletions