[Cuis-dev] Fwd: [RE:] Cuis Base Image Unit Test Fails: FileStreamTest>>testUpTo2IncompleteRecords
ken.dickey at whidbey.com
ken.dickey at whidbey.com
Thu Oct 9 15:44:39 PDT 2025
-------- Original Message --------
SUBJECT:
[RE:] Cuis Base Image Unit Test Fails:
FileStreamTest>>testUpTo2IncompleteRecords
DATE:
2025-10-09 15:43
FROM:
ken.dickey at whidbey.com
TO:
Squeak Machine Development Discussion
<vm-dev at lists.squeakfoundation.org>
More info:
FileStreamTest>>testUpTo2IncompleteRecords
Fails for both
squeak.cog.spur_linux64ARMv8.tar.gz
squeak.stack.spur_linux64ARMv8.tar.gz
also fails same for source build on OpenBSD
vm version of FAIL reports as 5.0-2025100522004
The same image SUCCESS on
vm version reports as 5.0-202508201437
Failing ASSERT code:
". the writing process comes back online and terminates its record
writing "
path asFileEntry appendContents: 'ord-2Xrecord-3X'.
". upTo reads an half token and then a complete one "
self assert: ((fs upTo: $X) = 'ord-2').
So, a recent VM or plugin problem, not a Cuis image/code problem.
FYI,
-KenD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20251009/72eeae90/attachment.htm>
-------------- next part --------------
'From Cuis7.5 [latest update: #7641] on 9 October 2025 at 3:42:18 pm'!
!FileStreamTest methodsFor: 'tests' stamp: 'jmv 5/19/2024 20:08:32'!
testUpTo2IncompleteRecords
"
. This test stresses the motivation for introducing upTo:delimiterIsTerminator:
. if two separate processes are reading and writing records into the same file
upTo can potentially create a bit a of a mess by reading in half records and complete records.
. please compare to the equivalent testUpToTerminatorX to see what is probably the behaviour your are looking for
"
| path fs |
path := 'test-{1}.txt' format: {(Float pi * 10e10) floor atRandom. } .
" a process starts to write data into a file but it does not end cleanly the writing "
path asFileEntry fileContents: 'record-1Xrec'.
fs := path asFileEntry readStream .
" upTo reads 'record-1' and the second time reads half a token "
self assert: ((fs upTo: $X) = 'record-1').
self assert: ((fs upTo: $X) = 'rec').
". the writing process comes back online and terminates its record writing "
path asFileEntry appendContents: 'ord-2Xrecord-3X'.
". upTo reads an half token and then a complete one "
self assert: ((fs upTo: $X) = 'ord-2').
self assert: ((fs upTo: $X) = 'record-3').
". when there is nothing more to read upTo returns the empty string "
self assert: ((fs upTo: $X) = '').
fs close .
path asFileEntry delete.
! !
More information about the Cuis-dev
mailing list