google-cloud-java icon indicating copy to clipboard operation
google-cloud-java copied to clipboard

ITChatSessionIntegrationTest failed with IllegalStateException (flaky)

Open zhumin8 opened this issue 1 year ago • 1 comments

ITChatSessionIntegrationTest:sendMessageMixedStreamAndUnary_historyOfFour and ITChatSessionIntegrationTest.sendMessageMixedStreamAndUnary_historyOfFour failed with IllegalStateException in GraalVM JDK 17 Nightly

Failures (2):
  JUnit Vintage:ITChatSessionIntegrationTest:sendMessageMixedStreamAndUnary_historyOfFour
    MethodSource [className = 'com.google.cloud.vertexai.it.ITChatSessionIntegrationTest', methodName = 'sendMessageMixedStreamAndUnary_historyOfFour', methodParameterTypes = '']
    => java.lang.IllegalStateException: Rerun getHistory() to get cleaned history.
       com.google.cloud.vertexai.generativeai.ChatSession.getHistory(ChatSession.java:357)
       com.google.cloud.vertexai.it.ITChatSessionIntegrationTest.sendMessageMixedStreamAndUnary_historyOfFour(ITChatSessionIntegrationTest.java:120)
       [email protected]/java.lang.reflect.Method.invoke([Method.java:568](https://cs.corp.google.com/#search/&sq=package:%5Epiper$%20project:openjdk21&q=java/lang/reflect/Method.java:568))
     Caused by: java.lang.IllegalStateException: The last round of conversation will not be added to history because response stream did not finish normally. Finish reason is RECITATION.
       com.google.cloud.vertexai.generativeai.ChatSession.checkFinishReasonAndEditHistory(ChatSession.java:339)
       com.google.cloud.vertexai.generativeai.ChatSession.lambda$checkLastResponseAndEditHistory$0(ChatSession.java:308)
       [email protected]/java.util.Optional.ifPresent([Optional.java:178](https://cs.corp.google.com/#search/&sq=package:%5Epiper$%20project:openjdk21&q=java/util/Optional.java:178))
       com.google.cloud.vertexai.generativeai.ChatSession.checkLastResponseAndEditHistory(ChatSession.java:305)
       com.google.cloud.vertexai.generativeai.ChatSession.getHistory(ChatSession.java:353)
       [...]
  JUnit Vintage:ITChatSessionIntegrationTest:sendMessageWithNewConfigs_historyContainsFullConversation
    MethodSource [className = 'com.google.cloud.vertexai.it.ITChatSessionIntegrationTest', methodName = 'sendMessageWithNewConfigs_historyContainsFullConversation', methodParameterTypes = '']
    => java.lang.IllegalStateException: The last round of conversation will not be added to history because response stream did not finish normally. Finish reason is RECITATION.
       com.google.cloud.vertexai.generativeai.ChatSession.checkFinishReasonAndEditHistory(ChatSession.java:339)
       com.google.cloud.vertexai.generativeai.ChatSession.lambda$checkLastResponseAndEditHistory$1(ChatSession.java:323)
       [email protected]/java.util.Optional.ifPresent([Optional.java:178](https://cs.corp.google.com/#search/&sq=package:%5Epiper$%20project:openjdk21&q=java/util/Optional.java:178))
       com.google.cloud.vertexai.generativeai.ChatSession.checkLastResponseAndEditHistory(ChatSession.java:316)
       com.google.cloud.vertexai.generativeai.ChatSession.sendMessage(ChatSession.java:243)
       com.google.cloud.vertexai.generativeai.ChatSession.sendMessage(ChatSession.java:233)

see log for details. This was resolved in rebuild.

Previously wrongly opened issue in https://github.com/googleapis/sdk-platform-java/issues/2931

zhumin8 avatar Jun 25 '24 15:06 zhumin8

Downgrade as not seen lately.

zhumin8 avatar Sep 16 '24 19:09 zhumin8