[ 
https://issues.apache.org/jira/browse/COLLECTIONS-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17530474#comment-17530474
 ] 

Bruno P. Kinoshita commented on COLLECTIONS-812:
------------------------------------------------

I think you nailed it [~samabcde] 

The test writes first to one stream, then to the next one. And every time it 
writes to the stream the Properties object keep track of the time it was 
updated. The .toByteArray() output will contain this time, which may vary since 
the two streams are written separately.

I reproduced it with the debugger, pausing for a few moments before the second 
stream is used.

!image-2022-05-01-11-49-01-033.png|width=701,height=331!

Let me see if I can re-write this test so that it doesn't happen anymore. It's 
also using the deprecated .save(), I'll replace it by .store().

Thank you!

Bruno

> Fragile test EmptyPropertiesTest.testSave
> -----------------------------------------
>
>                 Key: COLLECTIONS-812
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-812
>             Project: Commons Collections
>          Issue Type: Test
>    Affects Versions: 4.4
>            Reporter: Bruno P. Kinoshita
>            Priority: Minor
>         Attachments: image-2022-05-01-11-49-01-033.png, screenshot-1.png
>
>
> Fragile test EmptyPropertiesTest.testSave, found in 
> [https://github.com/apache/commons-collections/pull/304|https://github.com/apache/commons-collections/pull/304.]
> It passed after I kicked GH Actions.
> {noformat}
>     Error:  Failures: 
>     Error:    EmptyPropertiesTest.testSave:278 #Hello world!
>     #Fri Apr 29 16:05:40 GMT 2022
>      ==> array contents differ at index [32], expected: <52> but was: <51>
>     [INFO] 
>     Error:  Tests run: 22274, Failures: 1, Errors: 0, Skipped: 4 {noformat}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to