[ 
https://issues.apache.org/jira/browse/IGNITE-29182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Werner updated IGNITE-29182:
-----------------------------------
    Description: 
[https://ci2.ignite.apache.org/test/4772259840278572252?currentProjectId=IgniteTests24Java8&branch=%3Cdefault%3E]

SystemViewSnapshotsTest.testSnapshot failed with stacktrace:
org.junit.ComparisonFailure: expected:<[testGroup,MetaStorage]> but 
was:<[MetaStorage,testGroup]>
at org.junit.Assert.assertEquals(Assert.java:117)
at org.junit.Assert.assertEquals(Assert.java:146)
at 
org.apache.ignite.testframework.junits.JUnitAssertAware.assertEquals(JUnitAssertAware.java:65)
at 
org.apache.ignite.internal.metric.SystemViewSnapshotsTest.testSnapshot(SystemViewSnapshotsTest.java:85)

*Root cause*
The cacheGroups() value in the snapshot system view is built in 
IgniteSnapshotManager from SnapshotFileTree.existingCacheDirs(), which uses 
File.listFiles() — an unspecified, filesystem-dependent order.

The test asserted an exact comma-joined string with a hardcoded order, so the 
test is a flake: it only passes when the filesystem happens to return testGroup 
before MetaStorage.

*Fix*
Make the assertion order-independent in SystemViewSnapshotsTest.

  was:
[https://ci2.ignite.apache.org/test/4772259840278572252?currentProjectId=IgniteTests24Java8&branch=%3Cdefault%3E]

SystemViewSnapshotsTest.testSnapshot failed with stacktrace:
org.junit.ComparisonFailure: expected:<[testGroup,MetaStorage]> but 
was:<[MetaStorage,testGroup]>
at org.junit.Assert.assertEquals(Assert.java:117)
at org.junit.Assert.assertEquals(Assert.java:146)
at 
org.apache.ignite.testframework.junits.JUnitAssertAware.assertEquals(JUnitAssertAware.java:65)
at 
org.apache.ignite.internal.metric.SystemViewSnapshotsTest.testSnapshot(SystemViewSnapshotsTest.java:85)

*Root cause*
The cacheGroups() value in the snapshot system view is built in 
IgniteSnapshotManager from SnapshotFileTree.existingCacheDirs(), which uses 
File.listFiles() — an unspecified, filesystem-dependent order.

The test asserted an exact comma-joined string with a hardcoded order, so the 
test is a flake: it only passes when the filesystem happens to return testGroup 
before MetaStorage.

*Fix*
Make the assertion order-independent in SystemViewSnapshotsTest - compare as 
sets.


> Fix flaky SystemViewSnapshotsTest.testSnapshot
> ----------------------------------------------
>
>                 Key: IGNITE-29182
>                 URL: https://issues.apache.org/jira/browse/IGNITE-29182
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Dmitry Werner
>            Assignee: Dmitry Werner
>            Priority: Minor
>              Labels: MakeTeamcityGreenAgain
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> [https://ci2.ignite.apache.org/test/4772259840278572252?currentProjectId=IgniteTests24Java8&branch=%3Cdefault%3E]
> SystemViewSnapshotsTest.testSnapshot failed with stacktrace:
> org.junit.ComparisonFailure: expected:<[testGroup,MetaStorage]> but 
> was:<[MetaStorage,testGroup]>
> at org.junit.Assert.assertEquals(Assert.java:117)
> at org.junit.Assert.assertEquals(Assert.java:146)
> at 
> org.apache.ignite.testframework.junits.JUnitAssertAware.assertEquals(JUnitAssertAware.java:65)
> at 
> org.apache.ignite.internal.metric.SystemViewSnapshotsTest.testSnapshot(SystemViewSnapshotsTest.java:85)
> *Root cause*
> The cacheGroups() value in the snapshot system view is built in 
> IgniteSnapshotManager from SnapshotFileTree.existingCacheDirs(), which uses 
> File.listFiles() — an unspecified, filesystem-dependent order.
> The test asserted an exact comma-joined string with a hardcoded order, so the 
> test is a flake: it only passes when the filesystem happens to return 
> testGroup before MetaStorage.
> *Fix*
> Make the assertion order-independent in SystemViewSnapshotsTest.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to