Skip to content
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

Investigate JRuby test failures #459

Closed
radar opened this issue Jan 6, 2019 · 2 comments
Closed

Investigate JRuby test failures #459

radar opened this issue Jan 6, 2019 · 2 comments

Comments

@radar
Copy link
Collaborator

radar commented Jan 6, 2019

JRuby is failing some of the Travis tests, but only seemingly with the default Gemfile + the Rails master gemfile: https://travis-ci.org/ruby-i18n/i18n/builds/476071556?utm_source=github_status&utm_medium=notification.

I cannot reproduce this issue locally. I would love some help to investigate this issue.

@knapo
Copy link
Collaborator

knapo commented Jan 7, 2019

Hey @radar!

I did a quick check and found out that under a certain jruby builds (even not versions) hash or Hash is weirdly calculated - it has the same value for different Hashes.

# puts "I18n.cache_key_digest #{key.class} #{key.inspect} #{key.hash}"
I18n.cache_key_digest  Hash {:foo=>1, :bar=>2} -2017438026604914721
I18n.cache_key_digest  Hash {:foo=>2, :bar=>1} -2017438026604914721

I think it's safe to always calculate hash from string, and I believe it was the initial idea behind this. We could jsonize keys, but it's a bit overkill I think.

Also, there were a random failures, which (I think) were related to the fact that the cache was not cleared after each test case.

I'll submit a PR in a while.

@radar
Copy link
Collaborator Author

radar commented Jan 7, 2019

Thank you very much for looking into this @knapo!

@radar radar closed this as completed in 36f70ce Feb 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants