[Bioc-devel] Spurious errors unit testing on R CMD check
Hector Corrada Bravo
hcorrada at gmail.com
Wed May 4 20:29:04 CEST 2016
There were two small utility classes with finalizers defined. They seem to
be the culprits. I've removed those finalizers and haven't seen errors so
far.
Thanks!
Hector
On Mon, May 2, 2016 at 1:18 AM, Hervé Pagès <hpages at fredhutch.org> wrote:
> Hi Michael, Hector,
>
> On 04/29/2016 01:11 PM, Michael Lawrence wrote:
>
>> No, those aren't reference classes. There are some reference classes
>> in GenomicFeatures (like TxDb) and BSgenome. I don't think they set
>> explicit finalize methods though.
>>
>
> No reference classes in IRanges, GenomicRanges, or BSgenome but there
> are finalizers defined on external pointers in IRanges (for NCList and
> GNCList objects) and on environments in BSgenome.
>
> H.
>
>
>
>> On Fri, Apr 29, 2016 at 12:58 PM, Hector Corrada Bravo
>> <hcorrada at gmail.com> wrote:
>>
>>> I've removed all finalizers on these classes for this version and are
>>> still
>>> seeing it. I'll try with gctorture on and see if I can track it down. Any
>>> finalizers on GenomicRanges? GNCList or GRanges?
>>>
>>> On Fri, Apr 29, 2016 at 3:42 PM, Michael Lawrence
>>> <lawrence.michael at gene.com> wrote:
>>>
>>>>
>>>> I don't think there are any reference classes in GenomeInfoDb. This
>>>> must be something weird happening to one of the epivizr reference
>>>> classes. It just shows up in that stack trace under GenomeInfoDb
>>>> because of the GC. I haven't managed to reproduce it yet though.
>>>>
>>>> Michael
>>>>
>>>> On Fri, Apr 29, 2016 at 12:15 PM, Michael Lawrence <michafla at gene.com>
>>>> wrote:
>>>>
>>>>> I can look into it. I guess it fails sporadically because of the
>>>>> garbage collector. Activating GC torture might make this easier to
>>>>> reproduce.
>>>>>
>>>>> On Fri, Apr 29, 2016 at 12:06 PM, Hector Corrada Bravo
>>>>> <hcorrada at gmail.com> wrote:
>>>>>
>>>>>> I've seen this type of error for a while and have really struggled to
>>>>>> track
>>>>>> it down. I have a package with unit tests that sporadically fail on R
>>>>>> CMD
>>>>>> check with errors of this type:
>>>>>>
>>>>>> ---
>>>>>>
>>>>>>> test_check("epivizrData")
>>>>>>>
>>>>>> 1. Error: new creates a proper object (@test-creation.R#17)
>>>>>> --------------------
>>>>>> attempt to apply non-function
>>>>>> 1: expect_equal(mgr$.seqinfo, GenomeInfoDb::Seqinfo()) at
>>>>>> testthat/test-creation.R:17
>>>>>> 2: compare(object, expected, ...)
>>>>>> 3: compare.default(object, expected, ...)
>>>>>> 4: all.equal(x, y, ...)
>>>>>> 5: all.equal.default(x, y, ...)
>>>>>> 6: GenomeInfoDb::Seqinfo()
>>>>>> 7: .normargGenome(genome, seqnames)
>>>>>> 8: rep.int(ugenome, length(seqnames))
>>>>>> 9: (function (classes, fdef, mtable)
>>>>>> {
>>>>>> methods <- .findInheritedMethods(classes, fdef, mtable)
>>>>>> if (length(methods) == 1L)
>>>>>> return(methods[[1L]])
>>>>>> else if (length(methods) == 0L) {
>>>>>> cnames <- paste0("\"", vapply(classes, as.character, ""),
>>>>>> "\"",
>>>>>> collapse = ", ")
>>>>>> stop(gettextf("unable to find an inherited method for
>>>>>> function
>>>>>> %s for signature %s",
>>>>>> sQuote(fdef at generic), sQuote(cnames)), domain = NA)
>>>>>> }
>>>>>> else stop("Internal error in finding inherited methods; didn't
>>>>>> return a unique method",
>>>>>> domain = NA)
>>>>>> })(list("character"), structure(function (x, times)
>>>>>> standardGeneric("rep.int"), generic = structure("rep.int",
>>>>>> package =
>>>>>> "base"), package = "base", group = list(), valueClass = character(0),
>>>>>> signature = c("x",
>>>>>> "times"), default = structure(function (x, times)
>>>>>> .Internal(rep.int(x, times)), target = structure("ANY", class =
>>>>>> structure("signature", package = "methods"), .Names = "x", package =
>>>>>> "methods"), defined = structure("ANY", class = structure("signature",
>>>>>> package = "methods"), .Names = "x", package = "methods"), generic =
>>>>>> structure("rep.int", package = "base"), class =
>>>>>> structure("derivedDefaultMethod", package = "methods")), skeleton =
>>>>>> (structure(function (x,
>>>>>> times)
>>>>>> .Internal(rep.int(x, times)), target = structure("ANY", class =
>>>>>> structure("signature", package = "methods"), .Names = "x", package =
>>>>>> "methods"), defined = structure("ANY", class = structure("signature",
>>>>>> package = "methods"), .Names = "x", package = "methods"), generic =
>>>>>> structure("rep.int", package = "base"), class =
>>>>>> structure("derivedDefaultMethod", package = "methods")))(x,
>>>>>> times), class = structure("standardGeneric", package =
>>>>>> "methods")),
>>>>>> <environment>)
>>>>>> 10: .findInheritedMethods(classes, fdef, mtable)
>>>>>> 11: .inheritedArgsExpression(m at target, m at defined, body(m))
>>>>>> 12: extends(target[[i]], defined[[i]], fullInfo = TRUE)
>>>>>> 13: target[[i]]
>>>>>> 14: (function (x)
>>>>>> x$.self$finalize())(<environment>)
>>>>>> ---
>>>>>>
>>>>>> I do not define any finalize method on classes defined on my package.
>>>>>> This
>>>>>> stems from a finalizer on a class defined in a package imported by my
>>>>>> package (GenomeInfoDb), which I'm guessing is detached from the
>>>>>> environment
>>>>>> before this finalize function is called.
>>>>>>
>>>>>> Any ideas on how to avoid this error?
>>>>>>
>>>>>> Package source here:
>>>>>> https://github.com/bioconductor-mirror/epivizrData
>>>>>>
>>>>>> [[alternative HTML version deleted]]
>>>>>>
>>>>>> _______________________________________________
>>>>>> Bioc-devel at r-project.org mailing list
>>>>>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>>>>>
>>>>>>
>>>
>>>
>> _______________________________________________
>> Bioc-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>
>>
> --
> Hervé Pagès
>
> Program in Computational Biology
> Division of Public Health Sciences
> Fred Hutchinson Cancer Research Center
> 1100 Fairview Ave. N, M1-B514
> P.O. Box 19024
> Seattle, WA 98109-1024
>
> E-mail: hpages at fredhutch.org
> Phone: (206) 667-5791
> Fax: (206) 667-1319
>
[[alternative HTML version deleted]]
More information about the Bioc-devel
mailing list