Skip to content

Conversation

@maleadt
Copy link
Member

@maleadt maleadt commented Feb 24, 2017

Ref #20150, cherry-picked from b7c850e

Reason for backport: after converting CUDAdrv.jl to using testsets, some finalizers weren't being called anymore, but only on 0.5.

Repro:

using Base.Test

type Foo
    whatever    # prevent singleton object
    function Foo()
        obj = new(nothing)
        finalizer(obj, finalize)
        return obj
    end
end

finalized = false
function finalize(obj::Foo)
    global finalized
    finalized = true
end

@testset "dummy" begin
    dummy = Foo()
    @test_throws MethodError sin(dummy)
end

try throw(nothing) end
gc()
@assert finalized

This is semi important to me, because for CUDAdrv.jl (any other GPU packages too) finalizers are responsible for freeing GPU memory, and without this backport we can't test whether that works reliably.

cc @KristofferC

@KristofferC
Copy link
Member

Don't think this should break anything so should be fine to backport.

@tkelman tkelman changed the base branch from release-0.5 to tk/backports-0.5.1 February 24, 2017 20:26
@kshyatt kshyatt added the testsystem The unit testing framework and Test stdlib label Feb 24, 2017
@tkelman
Copy link
Contributor

tkelman commented Feb 25, 2017

adding a field could cause issues if anyone is constructing the type directly

@maleadt
Copy link
Member Author

maleadt commented Feb 25, 2017

PkgEval? Or I can do a GitHub search for DefaultTestSet and test matching packages after this change.

@maleadt
Copy link
Member Author

maleadt commented Feb 25, 2017

Dug through the GitHub code search results and couldn't find anyone constructing a DefaultTestSet by specifying all fields.
@tkelman do you object to this change because it could be breaking?

@KristofferC
Copy link
Member

KristofferC commented Feb 25, 2017

This shouldn't influence any user facing API. In my opinion we have to allow things like this or else we can't backported anything, because any change in behaviour is potentially breaking for someone who relies on that behaviour.

@vchuravy vchuravy requested a review from tkelman February 27, 2017 12:01
@maleadt maleadt merged commit 6807038 into tk/backports-0.5.1 Feb 28, 2017
@maleadt maleadt deleted the tb/backport-20150 branch February 28, 2017 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testsystem The unit testing framework and Test stdlib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants