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

test: reproduce possible Hash inconsistency when [] / []= concurrently #384

Merged
merged 1 commit into from Oct 10, 2017

Conversation

kares
Copy link
Contributor

@kares kares commented Oct 1, 2017

... a sometimes reproducer for #51 (needs a GIL free Ruby such as JRuby)

so that shipping #352 is justified // cc @radar

... a sometimes reproducer  for ruby-i18n#51 (needs a GIL free Ruby such as JRuby)
@kares
Copy link
Contributor Author

kares commented Oct 1, 2017

NOTE: it might not always fail, the outcome is simply non-deterministic

... for me, on JRuby 9.1.13.0, the failure shows up at least once in ~ 5-7 runs :

$ ruby -w -I"lib:lib:test" -I"/opt/local/rvm/gems/jruby-9.1.13.0@temp/gems/rake-12.1.0/lib" "/opt/local/rvm/gems/jruby-9.1.13.0@temp/gems/rake-12.1.0/lib/rake/rake_test_loader.rb" "test/backend/memoize_test.rb" 
test_declarative is deprecated for Minitest::Unit::TestCase
test_declarative is deprecated for Minitest::Test
Run options: --seed 57362

# Running:

.....................{:foo=>{:"scoped.sample"=>"[:foo, :scoped, :sample]"}, :bar=>{:"scoped.sample"=>"[:bar, :scoped, :sample]"}, :baz=>{:"scoped.sample"=>"[:baz, :scoped, :sample]"}}
F..........

Finished in 0.716656s, 44.6518 runs/s, 46.0472 assertions/s.

  1) Failure:
I18nBackendMemoizeTest#test_lookup_concurrent_consistency [/home/kares/workspace/oss/i18n/test/backend/memoize_test.rb:78]:
NON-THREAD-SAFE lookup memoization backend: Hash.
Expected: 3
  Actual: 4

Copy link
Collaborator

@radar radar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for your work on this!

@radar radar merged commit 4b36936 into ruby-i18n:master Oct 10, 2017
@radar radar mentioned this pull request Oct 10, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants