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
DecodeSpec
flake
#7256
Comments
@armanbilge There should be
And after that bug is not reproducible (had been fixed?)... |
@eshu Thanks for looking! Can you reproduce the bug with the exact commit I mentioned? |
@armanbilge I replaced content of
in |
@armanbilge
Is it correct or I did something wrong? |
@eshu, sorry I should have clarified: what I mean by "checkout" is if you do
And then fix the seed, like you did above. d05e809 was the commit that originally had the flake, so we should make sure that we can still reproduce that. Then, if d05e809 is broken, but as you say the current code is working, we may want to do a Let me know if that makes sense! Thanks for all your work. |
@armanbilge Sorry, I am not very good with git, and I see the error I've never seen before
Also there is the message on the page d05e809: |
@eshu here, I created a branch with that commit, that should make it easier :) |
Oh, I just realized maybe there is some confusion ... I'm so sorry! The title of this issue is "
In the repository, we also have a |
So The problem was not reproduced even with branch you kindly made for me... Sorry, I am completely new in this community, just want to learn more, this is why so many questions and misunderstandings :( |
Please don't apologize, and ask as many questions as you need to! We are happy to have you here :) Sometimes things are confusing and I don't realize right away, like about "flake".
Hmm, thanks for trying that. Until we can reproduce the bug successfully, it's not safe to make any assumption whether it is fixed or not. Instead of using the seed, let's try this. I see that the test output reported the inputs that caused the failure. So maybe we can manually create a test for those arguments and see what happens. Do you think you can give that a try?
Btw, feel free to open a draft PR with the test you add. This will make it easier for us to follow your progress and give help. |
@armanbilge If you do not mind I will push changes to your branch. I applied exact parameters as you told me, but... |
@eshu sure, go ahead! I don't think you can push directly to that branch, but you can base off of it and push to your fork. |
The PR is here: #7301 The problem is that I can't run native tests on my PC, they are failed with OOM. JS tests does not work probably because I did not install node. |
@eshu nice work! It looks like this bug is specific to JS and Native. Because the behavior is not matching the JVM, it's possible that this is actually not an http4s bug, but a bug in Scala.js and Scala Native. The next step would be to try and make a minimal example that shows how the behavior differs on JVM vs JS/Native. |
@armanbilge
Native failure is:
Also native throws a lot of warnings like
I will try to figure out what is going on, but id you have any hints please tell. |
@eshu it looks like you are running out of memory. Try running sbt with more memory e.g. |
Yes, just figured it out. Looks like "12Gb ought to be enough for anybody" 🤣 |
It looks like decoding happens in fs2 (at least the whole line val decoded = source.through(decodeWithCharset[Fallible](cs.nioCharset)).compile.string contains only fs2 calls). I added the case to the PR: https://github.com/http4s/http4s/pull/7301/files#diff-2f31accbcdaf36e1daabdefba980864af96c94b0cd2efc1f7cfeacbd6a8ea70fR81 |
Huh, that's strange. That seems like a bug of its own ... In any case, nice job narrowing that down! If I understand correctly, FS2 is stripping the BOM, but the JDK is not? I think FS2 is doing the right thing here by stripping the BOM. So maybe we need to adjust the assertion in our test to account for that as well. I wonder why the JDK doesn't strip the BOM 🤔 |
@armanbilge JVM tests does not receive BOM at all. JVM and JS generates strings for tests differently. As I show in the additional test, if BOM string is passed forcible in JVM, it is striped as well. I can stripe BOM bytes from the test expected string if you approve it. |
Yes, if you don't mind, you can propose a fix in your PR exactly like that. I think it makes sense, but I need to take a closer look, and I'd like a second opinion from another maintainer. |
I fixed the old test and wrote the new one, and I found the simple test for BOM there: https://github.com/http4s/http4s/blob/series/0.23/tests/shared/src/test/scala/org/http4s/DecodeSpec.scala#L90 I just think: what if somebody creates |
We already have a Lines 1 to 6 in 778f3d0
That configures the maximum memory that we can use in the CI runners. I'm not sure why your system needed more memory than that ... |
@armanbilge It looks like a compilation issue for native, it happens before tests run. Maybe because of Java version?
Or maybe I need to install something else... For JS it happens after tests
|
d05e809
https://github.com/http4s/http4s/actions/runs/6009428051/job/16298838183?pr=7255
The text was updated successfully, but these errors were encountered: