googleapis / google-cloud-java

Google Cloud Client Library for Java
https://cloud.google.com/java/docs/reference
Apache License 2.0
1.9k stars 1.06k forks source link

Flaky Vertex IT: ITChatSessionIntegrationTest - IllegalStateException #11157

Open burkedavison opened 1 month ago

burkedavison commented 1 month ago

https://btx.cloud.google.com/invocations/5e0ae46c-2e23-4a31-89de-25ab5874b842/log

08:07:57:960 [ERROR] Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 9.361 s <<< FAILURE! -- in com.google.cloud.vertexai.it.ITChatSessionIntegrationTest
08:07:57:961 [ERROR] com.google.cloud.vertexai.it.ITChatSessionIntegrationTest.sendMessageWithNewConfigs_historyContainsFullConversation -- Time elapsed: 2.478 s <<< ERROR!
java.lang.IllegalStateException: Rerun getHistory() to get cleaned history.
    at com.google.cloud.vertexai.generativeai.ChatSession.getHistory(ChatSession.java:357)
    at com.google.cloud.vertexai.it.ITChatSessionIntegrationTest.sendMessageWithNewConfigs_historyContainsFullConversation(ITChatSessionIntegrationTest.java:162)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
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.
    at com.google.cloud.vertexai.generativeai.ChatSession.checkFinishReasonAndEditHistory(ChatSession.java:339)
    at com.google.cloud.vertexai.generativeai.ChatSession.lambda$checkLastResponseAndEditHistory$0(ChatSession.java:308)
    at java.base/java.util.Optional.ifPresent(Optional.java:178)
    at com.google.cloud.vertexai.generativeai.ChatSession.checkLastResponseAndEditHistory(ChatSession.java:305)
    at com.google.cloud.vertexai.generativeai.ChatSession.getHistory(ChatSession.java:353)
    ... 2 more
mpeddada1 commented 4 days ago

Ran into this flaky test recently in nightly job