On Fri, Apr 10, 2009 at 11:44 PM, John M McIntosh < [email protected]> wrote:
> In my past dealings with insanity like this is that Sunits for a test > case run technically in no particular order. > However if you have cases where a test case A alters things for B, > then you get failure if B runs before A. > The order is dependent on how the set is created. > > Also there can be issues if things like File Handles are over- > allocated and you then rely on finalization to > fix things, which could interfere with things er it's hard to > explain, but once you see it, you know. > Technically this should not be a problem but as you see well something > is funky. > > What I'd suggest is print the context at the point of error in the > SUnit error handler so you can get some understanding of the failure > case. > > Smalltalk logError:'Fatal error: Sunit Fialed' inContext: thisContext > to: 'SqueakDebugXXXX.log'. Thanks for the advice John. Very useful, not only for this case. I will try it. Thanks! > > I also altered errorReportOn: to slop more data out, in Tweak based > system it's not uncommon to have stack nesting of > 100 methods. > Never can have enough debug data at hand. > > Contextpart>>errorReportOn: strm > "Write a detailed error report on the stack (above me) on a stream. > For both the error file, and emailing a bug report. Suppress any > errors while getting printStrings. Limit the length." > > | cnt aContext startPos | > strm print: Date today; space; print: Time now; cr. > strm cr. > strm nextPutAll: 'VM: '; > nextPutAll: SmalltalkImage current platformName asString; > nextPutAll: ' - '; > nextPutAll: SmalltalkImage current platformSubtype asString; > nextPutAll: ' - '; > nextPutAll: SmalltalkImage current osVersion asString; > nextPutAll: ' - '; > nextPutAll: SmalltalkImage current vmVersion asString; > cr. > strm nextPutAll: 'Image: '; > nextPutAll: SystemVersion current version asString; > nextPutAll: ' ['; > nextPutAll: SmalltalkImage current lastUpdateString > asString; > nextPutAll: ']'; > cr. > strm cr. > SecurityManager default printStateOn: strm. > > "Note: The following is an open-coded version of > ContextPart>>stackOfSize: since this method may be called during a low > space condition and we might run out of space for allocating the full > stack." > cnt := 0. startPos := strm position. > aContext := self. > [aContext notNil and: [(cnt := cnt + 1) < 40]] whileTrue: > [aContext printDetails: strm. "variable values" > strm cr. > aContext := aContext sender]. > > strm cr; nextPutAll: '--- The full stack ---'; cr. > aContext := self. > cnt := 0. > [aContext == nil] whileFalse: > [cnt := cnt + 1. > cnt = 40 ifTrue: [strm nextPutAll: ' - - - - - - - - - - - - > - - - - > - - - - - - - - - - - - - - - - -'; cr]. > strm print: aContext; cr. "just class>>selector" > > strm position > (startPos+150000) ifTrue: [strm nextPutAll: > '...etc...'. > ^ self]. "exit early" > cnt > 200 ifTrue: [strm nextPutAll: '-- and more not shown > --'. ^ > self]. > aContext := aContext sender]. > > > > On 10-Apr-09, at 5:19 PM, Mariano Martinez Peck wrote: > > > In Pharo core, it is sometimes green and sometime yellow > > > > I put some flags and see this: > > > \\ > -- > = > = > = > ======================================================================== > John M. McIntosh <[email protected]> > Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com > = > = > = > ======================================================================== > > > > -- > = > = > = > ======================================================================== > John M. McIntosh <[email protected]> > Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com > = > = > = > ======================================================================== > > > > > _______________________________________________ > Pharo-project mailing list > [email protected] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >
_______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
