[squeak-dev] Re: Debugging a primitive failure

Frank Shearar frank.shearar at gmail.com
Mon Jan 6 13:48:17 UTC 2014


On 6 January 2014 11:40, Frank Shearar <frank.shearar at gmail.com> wrote:
> At any rate, I've managed to do this three times in a row. Something's
> not right somewhere. How might I start trying to debug this?
>
> I would try save the image and offer it up for inspection, but of
> course I can't do that because that involves the changes file. I can't
> even file out a changeset, class or method. I'm going to try redo the
> changes I made, and prep a changeset. To be clear: I only see the
> failure when I run the test, and that somehow breaks the changes file.

In a COPY of your latest trunk image, run the attached changeset. Open
up a TestRunner. Run the MCPackageTest. Try debug the failure. You
should see a debugger pop up complaining that primSize failed on your
changes file. At least, that's what happens locally. After this, your
changes file is corrupt, in that nothing touching the changes file
works anymore (primSize failures).

(The test _should_ fail, because you probably won't have Inbox's
Monticello-fbs.582 loaded, which would let you load MC definitions
into an environment. That's not the point: the breaking of the changes
file is the point.)

frank
-------------- next part --------------
'From Squeak4.4 of 6 January 2014 [latest update: #13594] on 6 January 2014 at 1:34:09 pm'!
Smalltalk globals exportSelf!
MCTestCase subclass: #MCEnvironmentLoadTest
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Tests-Monticello'!
TestCase subclass: #MCTestCase
	instanceVariableNames: 'environment '
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Tests-Monticello'!

!MCTestCase methodsFor: 'running' stamp: 'fbs 1/6/2014 13:33'!
setUp
	environment := Environment withName: ('{1} test environment' format: {self className}).
	environment import: Smalltalk globals.! !

!MCTestCase methodsFor: 'running' stamp: 'fbs 1/6/2014 10:59'!
tearDown
	environment destroy.
	environment := nil.
	self clearPackageCache! !


!MCDictionaryRepositoryTest methodsFor: 'as yet unclassified' stamp: 'fbs 1/6/2014 11:01'!
setUp
	super setUp.
	repository :=  MCDictionaryRepository new dictionary: self dictionary! !


!MCDirectoryRepositoryTest methodsFor: 'as yet unclassified' stamp: 'fbs 1/6/2014 11:01'!
setUp
	super setUp.
	repository := MCDirectoryRepository directory: self directory! !


!MCFileInTest methodsFor: 'running' stamp: 'fbs 1/6/2014 11:00'!
setUp
	super setUp.
	expected := self mockSnapshot.
	stream := RWBinaryOrTextStream on: String new.! !


!MCMczInstallerTest methodsFor: 'as yet unclassified' stamp: 'fbs 1/6/2014 11:00'!
setUp
	super setUp.
	expected := self mockVersion.
	self change: #one toReturn: 2.! !


!MCMethodDefinitionTest methodsFor: 'running' stamp: 'fbs 1/6/2014 11:01'!
setUp
	super setUp.
	navigation := (Smalltalk hasClassNamed: #SystemNavigation)
		ifTrue: [(Smalltalk at: #SystemNavigation) new]
		ifFalse: [Smalltalk].
	isModified := self ownPackage modified.
	overrideTimestamp := (self class >> #override) timeStamp! !


!MCPackageTest methodsFor: 'tests' stamp: 'fbs 1/6/2014 11:05'!
testUnload
	| mock |
	[MCPackageLoader installSnapshot: self mockSnapshot.
	self mockPackage unload]
		on: EnvironmentRequest do: [:e | e resume: environment].
	self deny: (environment hasClassNamed: #MCMockClassA).
	self deny: (MCSnapshotTest includesSelector: #mockClassExtension).

	mock := environment classNamed: #MCMock.
	self assert: (mock subclasses noneSatisfy: [:c | c name = #MCMockClassA])! !


!MCPatchTest methodsFor: 'as yet unclassified' stamp: 'fbs 1/6/2014 11:01'!
setUp
	|rev1 rev2|
	super setUp.
	rev1 :=  MCSnapshotResource takeSnapshot.
	self change: #one toReturn: 2.
	rev2 :=  MCSnapshotResource takeSnapshot.
	patch := rev2 patchRelativeToBase: rev1.
	self change: #one toReturn: 1.! !


!MCSnapshotBrowserTest methodsFor: 'running' stamp: 'fbs 1/6/2014 11:01'!
setUp
	super setUp.
	model := MCSnapshotBrowser forSnapshot: MCSnapshotResource current snapshot.
	self buildWindow! !


!MCSnapshotTest methodsFor: 'running' stamp: 'fbs 1/6/2014 11:01'!
setUp
	super setUp.
	snapshot :=  self mockSnapshot.! !

!MCSnapshotTest methodsFor: '*Tests-MonticelloMocks' stamp: 'ab 7/7/2003 23:21'!
mockClassExtension! !


!MCStWriterTest methodsFor: 'running' stamp: 'fbs 1/6/2014 11:02'!
setUp
	super setUp.
	stream := RWBinaryOrTextStream on: String new.
	writer := MCStWriter on: stream.
! !


!MCVersionTest methodsFor: 'running' stamp: 'fbs 1/6/2014 11:02'!
setUp
	super setUp.
	visited := OrderedCollection new.! !


!MCWorkingCopyRenameTest methodsFor: 'running' stamp: 'fbs 1/6/2014 11:02'!
setUp
	| repos1 repos2 |
	super setUp.
	repositoryGroup := MCRepositoryGroup new.
	workingCopy := MCWorkingCopy forPackage: self mockPackage.
	versions := Dictionary new.
	versions2 := Dictionary new.
	repos1 := MCDictionaryRepository new dictionary: versions.
	repos2 := MCDictionaryRepository new dictionary: versions2.
	repositoryGroup addRepository: repos1.
	repositoryGroup addRepository: repos2.
	MCRepositoryGroup default removeRepository: repos1; removeRepository: repos2.
	workingCopy repositoryGroup: repositoryGroup.
	savedInitials := Utilities authorInitialsPerSe.
	Utilities setAuthorInitials: 'abc'.! !


!MCWorkingCopyTest methodsFor: 'running' stamp: 'fbs 1/6/2014 11:02'!
setUp
	| repos1 repos2 |
	super setUp.
	self clearPackageCache.
	repositoryGroup := MCRepositoryGroup new.
	workingCopy := MCWorkingCopy forPackage: self mockPackage.
	versions := Dictionary new.
	versions2 := Dictionary new.
	repos1 := MCDictionaryRepository new dictionary: versions.
	repos2 := MCDictionaryRepository new dictionary: versions2.
	repositoryGroup addRepository: repos1.
	repositoryGroup addRepository: repos2.
	MCRepositoryGroup default removeRepository: repos1; removeRepository: repos2.
	workingCopy repositoryGroup: repositoryGroup.
	savedInitials := Utilities authorInitialsPerSe.
	Utilities setAuthorInitials: 'abc'.! !


!MCStWriterTest reorganize!
('asserting' assertAllChunksAreWellFormed assertChunkIsWellFormed: assertContentsOf:match: assertMethodChunkIsWellFormed:)
('data' expectedClassDefinitionA expectedClassDefinitionB expectedClassMethodDefinition expectedMethodDefinition expectedMethodDefinitionWithBangs expectedOrganizationDefinition)
('running' setUp tearDown)
('testing' expectedInitializerA methodWithBangs testClassDefinitionA testClassDefinitionB testClassMethodDefinition testInitializerDefinition testMethodDefinition testMethodDefinitionWithBangs testOrganizationDefinition)
!


!MCStReaderTest reorganize!
('testing' commentWithStyle commentWithoutStyle methodWithStyle testCommentWithStyle testCommentWithoutStyle testMethodWithStyle)
!


!MCSnapshotTest reorganize!
('running' setUp)
('tests' testCreation testInstanceReuse)
('*Tests-MonticelloMocks' mockClassExtension)
!

MCPackageTest removeSelector: #tearDown!

!MCPackageTest reorganize!
('tests' testUnload)
!

MCEnvironmentLoadTest removeSelector: #setUp!
TestCase subclass: #MCTestCase
	instanceVariableNames: 'environment'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Tests-Monticello'!


More information about the Squeak-dev mailing list