Skip to content

Use per-test individual registry key so that tests can be run in parallel - #6

Closed
larskanis wants to merge 1 commit into
masterfrom
paralleltest
Closed

larskanis wants to merge 1 commit into
masterfrom
paralleltest

Conversation

@larskanis

Copy link
Copy Markdown
Collaborator

Regarding conversation in #5:

   I'm not sure what's better to use volatile environment and (unused_value)[https://github.com/ruby/ruby/blob/master/test/win32/test_registry.rb#L86] block. This repository don't use that. What's do you think that?

Using a random subkey versus a fixed one is probably necessary to run the tests in parallel. This is no problem in this repository, but in ruby/ruby. I can change this.

Win32::Registry::HKEY_CURRENT_USER.create(@test_registry_key).close

reg = Win32::Registry::HKEY_CURRENT_USER.open(backslachs(TEST_REGISTRY_KEY), Win32::Registry::KEY_ALL_ACCESS)
reg = Win32::Registry::HKEY_CURRENT_USER.open(@test_registry_key, Win32::Registry::KEY_ALL_ACCESS)

@nobu nobu Oct 6, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since registry keys can include /, it is wrong to use File methods to split them.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's only used for testing, where we have full control about our test keys. Nevertheless I'll change it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My concern is that it might encourage to write wrong code in other places.

@nobu

nobu commented Oct 7, 2024

Copy link
Copy Markdown
Member

I thought it would be safer to use volatile environment registries, which disappear at reboot, to test.
Not only teardown, I think registry database file bloat is a well-known problem.
Is there anything that can't be tested on volatile environment registries?

@hsbt

hsbt commented Oct 9, 2024

Copy link
Copy Markdown
Member

FYI: I merged win32-registry to ruby/ruby with the current master HEAD revision at ruby/ruby#11791.

I prefer this approach.

@larskanis

Copy link
Copy Markdown
Collaborator Author

I opened a new PR in #8 using volatile environment and avoiding File methods.

@nobu

nobu commented Oct 17, 2024

Copy link
Copy Markdown
Member

Close in favor of #8.

@nobu nobu closed this Oct 17, 2024
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.

3 participants