[ https://issues.apache.org/jira/browse/HDFS-16991?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17749179#comment-17749179 ]
ASF GitHub Bot commented on HDFS-16991: --------------------------------------- fanluoo commented on PR #5591: URL: https://github.com/apache/hadoop/pull/5591#issuecomment-1658259971 > LGTM. Have triggered the build again, if the build is green will merge by EOD @ayushtkn Unfortunately, the build failed,it's seems something authorization failed, Could you help to take a look again > Fix testMkdirsRaceWithObserverRead > ---------------------------------- > > Key: HDFS-16991 > URL: https://issues.apache.org/jira/browse/HDFS-16991 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs > Affects Versions: 3.3.4 > Reporter: fanluo > Assignee: fanluo > Priority: Minor > Labels: pull-request-available > > The test case testMkdirsRaceWithObserverRead which in TestObserverNode > sometimes failed like this: > {code:java} > java.lang.AssertionError: Client #1 lastSeenStateId=-9223372036854775808 > activStateId=5 > null at org.junit.Assert.fail(Assert.java:89) > at org.junit.Assert.assertTrue(Assert.java:42) > at > org.apache.hadoop.hdfs.server.namenode.ha.TestObserverNode.testMkdirsRaceWithObserverRead(TestObserverNode.java:607) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) > at > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) > {code} > i think the Thread.sleep() should move into the sub threads, like this: > {code:java} > public void run() { > try { > fs.mkdirs(DIR_PATH); > Thread.sleep(150); // wait until mkdir is logged > clientState.lastSeenStateId = HATestUtil.getLastSeenStateId(fs); > assertSentTo(fs, 0); FileStatus stat = fs.getFileStatus(DIR_PATH); > assertSentTo(fs, 2); > assertTrue("Should be a directory", stat.isDirectory()); > } catch (FileNotFoundException ioe) { > clientState.fnfe = ioe; > } catch (Exception e) { > fail("Unexpected exception: " + e); > } > } {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org