risdenk commented on a change in pull request #528:
URL: https://github.com/apache/knox/pull/528#discussion_r783212715



##########
File path: 
gateway-test-release/webhdfs-kerb-test/src/test/resources/org/apache/knox/gateway/SecureKnoxShellTest/SecureWebHdfsPutGet.groovy
##########
@@ -30,6 +30,7 @@ session = KnoxSession.kerberosLogin(gateway, jaasConf, 
krb5conf, true)
 status = Hdfs.status(session).file( "/" ).now().string
 
 Hdfs.put( session ).file( file ).to( dataDir + "/" + dataFile ).now()
+Thread.sleep(1000)

Review comment:
       I'm suggesting don't just do a `Thread.sleep` when there is some timing 
issue here.
   
   I would expect `Hdfs.put( session ).file( file ).to( dataDir + "/" + 
dataFile ).now()` to return when the file is actually created. So there is some 
bug there along the line that it returns without the file actually being there 
somehow. (No idea if this is a bug in HDFS, WebHDFS, Knox, etc).
   
   The fix you put in could work, but it might make sense to check if the file 
is created in a loop (ie: while not created `Thread.sleep(200)` or something 
like that). This would avoid an overloaded CI machine from artificially failing 
due to file not being ready yet.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to