Skip to content

Making test_winreg passes.#718

Merged
slozier merged 8 commits intoIronLanguages:masterfrom
in-code-i-trust:implement-thread-sentinel-lock-and-acquire-timeout
Jan 11, 2020
Merged

Making test_winreg passes.#718
slozier merged 8 commits intoIronLanguages:masterfrom
in-code-i-trust:implement-thread-sentinel-lock-and-acquire-timeout

Conversation

@in-code-i-trust
Copy link
Copy Markdown
Contributor

Hi,
I wrote a patch to resolve #410.

The code shown in #410 causes a deadlock because _set_sentinel() is not implemented as threading.py expects; an lock object returned by _set_sentinel() should be released on its thread exit.

I also implemented a lacking feature, timeout for acquire() as well.
According to the documentation, timeout is only supported on blocking acquire.

Copy link
Copy Markdown
Contributor

@slozier slozier left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

For whatever reason test_difflib and test_userlist timed out during CI. Rerunning now to see if it was a glitch, otherwise will need to investigate.

Would be nice to include the test from #410 in Tests/test_regressions.py. Did you try running test_winreg to see if this unblocks it?

Comment thread Src/IronPython.Modules/_thread.cs Outdated
@in-code-i-trust
Copy link
Copy Markdown
Contributor Author

Okay..., this PR is completely messed up. I’m sorry. I will fix it.
Thank you for rerunning tests and the review comments.

@in-code-i-trust in-code-i-trust force-pushed the implement-thread-sentinel-lock-and-acquire-timeout branch from db62aad to 51409e0 Compare January 11, 2020 11:46
@in-code-i-trust
Copy link
Copy Markdown
Contributor Author

@slozier
I've fixed the problems and enabled test_winreg. As you mentioned, the test code at #410 is now in test_regressions.

So here are what i've done in this PR.

  • Threads can now have multiple sentinel locks.
    • This makes test-all passes.
  • Implemented some lacking features in winreg.cs.
    • This makes test_winreg passes, so it's been enabled.
  • Ported the codes shown in test_winreg is blocking #410 to test_regressions.py.

@in-code-i-trust in-code-i-trust changed the title Implement _set_sentinel and timeout for lock.acquire() Making test_winreg passes. Jan 11, 2020
@in-code-i-trust in-code-i-trust force-pushed the implement-thread-sentinel-lock-and-acquire-timeout branch from e4559b2 to 5621acf Compare January 11, 2020 12:32
Copy link
Copy Markdown
Contributor

@slozier slozier left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for figuring out the issue and making test_winreg pass!

@slozier slozier merged commit e87c0d2 into IronLanguages:master Jan 11, 2020
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.

test_winreg is blocking

2 participants