agozhiy commented on issue #1910: DRILL-7393: Revisit Drill tests to ensure 
that patching is executed b…
URL: https://github.com/apache/drill/pull/1910#issuecomment-560639306
 
 
   @paul-rogers, the approach you suggested is reasonable and actually it is 
similar to the one used in Drill now. But it doesn't solve the original issue. 
Let me describe it:
   
   **Prerequisites:**
   - In java-exec module we have both tests that require patching (or use 
Drillbit) and standalone tests that don't need patching but might use some 
Guava classes (e.g. Closeables)
   
   **Steps:**
   1. Run tests by command:
   `mvn clean test -pl exec/java-exec -DforkCount=4`
   Changing forkCount is needed to increase probability of race conditions.
   2. Wait for failures.
   
   **Expected result:**
   Tests are passed.
   
   **Actual result:**
   Some tests will fail because patching didn't happen.
   
   So, let's see what is happening here:
   As we cannot guarantee the tests execution order, it is quite possible that 
a test that doesn't init patching will run first. It is also possible that this 
test is using some Guava class inside (and it'll be loaded during the test 
execution). Once the class is loaded it cannot be patched (Javassist constructs 
a modified class, attempts to load it and fail with error "attempted  duplicate 
class definition for name"). Then, all patching-dependent tests will fail. I 
hope my explanation is clear.
   
   P.S.: Thank you for the feedback!

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to