hasnain-db commented on code in PR #43596:
URL: https://github.com/apache/spark/pull/43596#discussion_r1380349554


##########
common/network-common/src/test/java/org/apache/spark/network/ssl/ReloadingX509TrustManagerSuite.java:
##########
@@ -161,14 +161,17 @@ public void testReload() throws Exception {
       // At this point we haven't reloaded, just the initial load
       assertEquals(0, tm.reloadCount);
 
+      // Wait so that the file modification time is different
+      Thread.sleep((tm.getReloadInterval() + 200));

Review Comment:
   thanks, fixing.
   
   also, for future people seeing this: the reason this is needed is that in 
certain scenarios this can run too fast, so the modification time of the 
original trust store and the one we create right after this is the same - in 
which case we do not reload the file, which fails this test.



##########
common/network-common/src/test/java/org/apache/spark/network/ssl/ReloadingX509TrustManagerSuite.java:
##########
@@ -161,14 +161,17 @@ public void testReload() throws Exception {
       // At this point we haven't reloaded, just the initial load
       assertEquals(0, tm.reloadCount);
 
+      // Wait so that the file modification time is different
+      Thread.sleep((tm.getReloadInterval() + 200));
+
       // Add another cert
       Map<String, X509Certificate> certs = new HashMap<String, 
X509Certificate>();
       certs.put("cert1", cert1);
       certs.put("cert2", cert2);
       createTrustStore(trustStore, "password", certs);
 
-      // Wait up to 5s until we reload
-      waitForReloadCount(tm, 1, 50);
+      // Wait up to 10s until we reload
+      waitForReloadCount(tm, 1, 100);

Review Comment:
   yeah, on a heavily loaded system (~40 load average on ~40 cores) this can 
take longer than 5s



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to