HADOOP-12603. TestSymlinkLocalFSFileContext#testSetTimesSymlinkToDir occasionally fail. Contributed by Wei-Chiu Chuang.

(cherry picked from commit d64cec0fdaddbb892d66ecff358f547b939005f1)
This commit is contained in:
cnauroth 2016-01-12 15:41:36 -08:00
parent 63b8be149a
commit 2605e78e44
3 changed files with 7 additions and 3 deletions

View File

@ -965,6 +965,9 @@ Release 2.8.0 - UNRELEASED
HADOOP-12584. Disable browsing the static directory in HttpServer2. HADOOP-12584. Disable browsing the static directory in HttpServer2.
(Robert Kanter via aajisaka) (Robert Kanter via aajisaka)
HADOOP-12603. TestSymlinkLocalFSFileContext#testSetTimesSymlinkToDir
occasionally fail. (Wei-Chiu Chuang via cnauroth)
Release 2.7.3 - UNRELEASED Release 2.7.3 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -1388,7 +1388,8 @@ public abstract class SymlinkBaseTest {
long at = wrapper.getFileLinkStatus(link).getAccessTime(); long at = wrapper.getFileLinkStatus(link).getAccessTime();
// the local file system may not support millisecond timestamps // the local file system may not support millisecond timestamps
wrapper.setTimes(link, 2000L, 3000L); wrapper.setTimes(link, 2000L, 3000L);
assertEquals(at, wrapper.getFileLinkStatus(link).getAccessTime()); assertTrue("The atime of symlink should not be lesser after setTimes()",
wrapper.getFileLinkStatus(link).getAccessTime() >= at);
assertEquals(2000, wrapper.getFileStatus(dir).getModificationTime()); assertEquals(2000, wrapper.getFileStatus(dir).getModificationTime());
assertEquals(3000, wrapper.getFileStatus(dir).getAccessTime()); assertEquals(3000, wrapper.getFileStatus(dir).getAccessTime());
} }

View File

@ -223,13 +223,13 @@ abstract public class TestSymlinkLocalFS extends SymlinkBaseTest {
@Override @Override
public void testSetTimesSymlinkToFile() throws IOException { public void testSetTimesSymlinkToFile() throws IOException {
assumeTrue(!Path.WINDOWS); assumeTrue(!Shell.WINDOWS && !Shell.SOLARIS);
super.testSetTimesSymlinkToFile(); super.testSetTimesSymlinkToFile();
} }
@Override @Override
public void testSetTimesSymlinkToDir() throws IOException { public void testSetTimesSymlinkToDir() throws IOException {
assumeTrue(!Path.WINDOWS); assumeTrue(!Path.WINDOWS && !Shell.SOLARIS);
super.testSetTimesSymlinkToDir(); super.testSetTimesSymlinkToDir();
} }