paul-rogers commented on pull request #11828:
URL: https://github.com/apache/druid/pull/11828#issuecomment-980389875


   Failing in `34294.18 (openjdk8) server module test` due to 
previously-untested code in `QueryResource`.
   
   Original line:
   ```java
         if (prevEtag != null && 
prevEtag.equals(responseContext.get(ResponseContext.Key.ETAG))) {
   ```
   
   Revised line:
   ```java
         if (prevEtag != null && 
prevEtag.equals(responseContext.getEntityTag())) {
   ```
   
   All we're doing is calling a method to get the `ETAG` value rather than 
grabbing it directly.
   
   Error:
   
   ```text
   Diff coverage statistics:
   
------------------------------------------------------------------------------
   |     lines      |    branches    |   functions    |   path
   
------------------------------------------------------------------------------
   | 100% (2/2)     |  25% (1/4)     |  50% (1/2)     | 
org/apache/druid/server/QueryResource.java
   
------------------------------------------------------------------------------
   
   ERROR: Insufficient branch coverage of 25% (1/4). Required 50%.
   ```
   
   This is odd because `QueryResource` cannot be tested (AFAIK) in a unit test 
since we cannot run a Druid server in a unit test. The `ETAG`, I'm told, has to 
do with query caching. Presumably, we do test query caching somewhere - 
integration tests?
   
   It seems this a case where the original author was not obligated to ensure 
sufficient tests exist, but us folks who come along later are required to 
rectify that oversight? In code that, seemingly, is not designed to allow unit 
testing?
   
   Suggestions?


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