-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Tests for odd_even_transposition_parallel #10926
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
Merged
cclauss
merged 14 commits into
TheAlgorithms:master
from
RaymondDashWu:odd_even_transposition_parallel_tests
Oct 27, 2023
Merged
Changes from 2 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c9823cc
[ADD] tests for odd_even_transposition_parallel
RaymondDashWu e6c73fc
adding another test because build failed 6 hrs
RaymondDashWu 863acc8
comment out all tests to see if it fails
RaymondDashWu 4c4571c
list(range(10)[::-1]) test uncommented
RaymondDashWu efe763c
[a, x, c] test uncommented
RaymondDashWu 5fe87a5
[1.9, 42.0, 2.8] test uncommented
RaymondDashWu da3db5e
[False, True, False] test uncommented
RaymondDashWu fb363a0
[1, 32.0, 9] test uncommented
RaymondDashWu c1b711f
[1, 32.0, 9] test uncommented
RaymondDashWu d863f86
[-442, -98, -554, 266, -491, 985, -53, -529, 82, -429] test uncommented
RaymondDashWu 9a11af7
Merge branch 'master' of https://github.com/TheAlgorithms/Python into…
RaymondDashWu 5ba4627
test non global lock
RaymondDashWu d62a0a1
[DEL] Testing multiple data types. Couldn't get doctest to work
RaymondDashWu 76d5932
[ADD] Comment on why non global process lock
RaymondDashWu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's comment out the doctests and see if the build passes. Then we can add tests one or two at a time until we find the infinite loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just finished pushing all the commits to experiment with. As expected, commenting out all the tests allowed the build to pass. I've made one commit for each test, leaving the rest of the tests commented out except that one. The only exception was the last 3, which were expected to throw exceptions as I couldn't even get those to work locally. If they all fail to build I'm not sure how to proceed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Please uncomment all the tests that work so that they run. Then leave a blank line and then the commented out tests that seem to run forever. I will look at those in my morning. Thanks for your persistence!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That won't be necessary as each test failed individually! I'm not familiar enough with the way Python does parallelization but I suspect that has something to do with why these tests all fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a lot of trial and error I finally figured it out! It had to do with the globally defined process lock. The only thing I couldn't figure out was how to test for multiple different data types. It threw out multiple exceptions with each of those tests and I couldn't figure out how to get those working in doctest. I tried adding
# doctest: +IGNORE_EXCEPTION_DETAIL
as well as playing around with ellipses (...
) to no avail.For example
odd_even_transposition([False, "a", 8]) == sorted([False, "a", 8])
output: