-
Notifications
You must be signed in to change notification settings - Fork 70
fix test failures on 1.12, avoid race condition in multithreaded partitioned writes #582
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
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5af9cfd
debug code on 1.12
palday 86c6005
early return
palday 58c1a9e
dictencode
palday c3dffb6
ExtendedTestSet
palday b387e5c
less indirection in loading additional test files
palday 62c6a99
Revert "dictencode"
palday ac66cf7
reuse the same lock
palday fb22434
note on race condition
palday 75c06ec
disable multithreaded writes
palday 29a04a6
format
palday 7622b09
revert unrelated changes
palday 58470ae
reduce depth in nesting test
palday f68a332
oops
palday db35d62
format
palday 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 hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,12 +28,16 @@ using DataAPI | |
| using FilePathsBase | ||
| using DataFrames | ||
| import Random: randstring | ||
| using TestSetExtensions: ExtendedTestSet | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. given how long the Arrow tests take, it's useful to have some indication of progress so that we can tell if tests have hung. ExtendedTestSet shows a (We also get colored diffs of arrays when tests fail, which is nice.) |
||
|
|
||
| # this formulation tests the loaded ArrowTypes, even if it's not the dev version | ||
| # within the mono-repo | ||
| include(joinpath(dirname(pathof(ArrowTypes)), "../test/tests.jl")) | ||
| include(joinpath(dirname(pathof(Arrow)), "../test/testtables.jl")) | ||
| include(joinpath(dirname(pathof(Arrow)), "../test/testappend.jl")) | ||
| include(joinpath(dirname(pathof(Arrow)), "../test/integrationtest.jl")) | ||
| include(joinpath(dirname(pathof(Arrow)), "../test/dates.jl")) | ||
|
|
||
| include(joinpath(@__DIR__, "testtables.jl")) | ||
| include(joinpath(@__DIR__, "testappend.jl")) | ||
| include(joinpath(@__DIR__, "integrationtest.jl")) | ||
| include(joinpath(@__DIR__, "dates.jl")) | ||
|
|
||
| struct CustomStruct | ||
| x::Int | ||
|
|
@@ -45,7 +49,7 @@ struct CustomStruct2{sym} | |
| x::Int | ||
| end | ||
|
|
||
| @testset "Arrow" begin | ||
| @testset ExtendedTestSet "Arrow" begin | ||
| @testset "table roundtrips" begin | ||
| for case in testtables | ||
| testtable(case...) | ||
|
|
@@ -381,6 +385,8 @@ end | |
| end | ||
|
|
||
| @testset "# 126" begin | ||
| # XXX This test also captures a race condition in multithreaded | ||
| # writes of dictionary encoded arrays | ||
| t = Tables.partitioner(( | ||
| (a=Arrow.toarrowvector(PooledArray([1, 2, 3])),), | ||
| (a=Arrow.toarrowvector(PooledArray([1, 2, 3, 4])),), | ||
|
|
@@ -602,14 +608,15 @@ end | |
| end | ||
|
|
||
| @testset "# 181" begin | ||
| # XXX this test hangs on Julia 1.12 when using a deeper nesting | ||
| d = Dict{Int,Int}() | ||
| for i = 1:9 | ||
| for i = 1:1 | ||
| d = Dict(i => d) | ||
| end | ||
| tbl = (x=[d],) | ||
| msg = "reached nested serialization level (20) deeper than provided max depth argument (19); to increase allowed nesting level, pass `maxdepth=X`" | ||
| @test_throws ErrorException(msg) Arrow.tobuffer(tbl; maxdepth=19) | ||
| @test Arrow.Table(Arrow.tobuffer(tbl; maxdepth=20)).x == tbl.x | ||
| msg = "reached nested serialization level (2) deeper than provided max depth argument (1); to increase allowed nesting level, pass `maxdepth=X`" | ||
| @test_throws ErrorException(msg) Arrow.tobuffer(tbl; maxdepth=1) | ||
| @test Arrow.Table(Arrow.tobuffer(tbl; maxdepth=5)).x == tbl.x | ||
| end | ||
|
|
||
| @testset "# 167" begin | ||
|
|
||
Oops, something went wrong.
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.
@quinnj I think there is a race condition baked into the current architecture that can't be addressed without a very large refactoring. The current architecture creates the locks on a worker thread if they don't already exist, which means that threads are competing for the creation of the initial lock. The locks should be created before any tasks are spawned.