-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gax-java(windows): HttpRequestRunnableTest.testUnicodeValuesInBody not passing for windows #1532
Comments
Thanks for digging @emmileaf! I was also just looking at this haha. For context, I was trying to resolve this issue: #1437 I think you're right about the octal sequence discrepancy on Windows. I'm not too familiar with this so I'm still trying to piece together why this didn't fail on linux/ why the escaped values passed locally. I was playing around with this locally (on my Mac) and I think one option is to just manually convert this back to a String with charset UTF-8.
Not ideal, but at least this would allow us to test that it does encode properly when creating the HttpRequest. |
Actually on a second look, perhaps the better fix is to ensure that the byteArrayOutputStream creates the String with UTF_8. The Javadocs seems to suggest that the Windows seems to run with UTF-16, but generating the string with UTF-16 gives me an error. Running it with
Perhaps something like might fix it?
|
Ah, that's probably it, thanks @lqiu96 for the investigation! I had trouble reproducing it with a mac setup as well, and was also looking for which step could be relying on an OS-specific default charset. Let's open a PR with this change and see if the error persists in the next nightly? |
Created a PR here: #1533 and added you as reviewer. We can trigger the nightly build after this going in and see if it works. |
Triggered the nightly here: https://github.com/googleapis/gapic-generator-java/actions/runs/4493029344 |
Thanks for the help @emmileaf! The nightly builds passed. |
Woot, thanks so much for the fix @lqiu96! |
This test looks like a more consistent source of failure for windows nightly builds, opening a single issue here to track and fix:
The com.google.api.gax.httpjson.HttpRequestRunnableTest.testUnicodeValuesInBody test fails on windows due to what looks like a octal sequence discrepancy:
https://github.com/googleapis/gapic-generator-java/blob/3922de4251924c5b765eba1319c253f13671a96f/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpRequestRunnableTest.java#L205-L212
https://github.com/googleapis/gapic-generator-java/blob/3922de4251924c5b765eba1319c253f13671a96f/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpRequestRunnableTest.java#L242
cc/ @lqiu96, if you have any context on this test from #1477?
The text was updated successfully, but these errors were encountered: