Remove concurrently removed elements from the result

Closes #13245
This commit is contained in:
Alexander Schwartz 2022-07-21 10:30:59 +02:00 committed by Hynek Mlnařík
parent cb81a17611
commit a14501dd77

View file

@ -558,6 +558,8 @@ public class JpaRealmProvider implements RealmProvider, ClientProvider, ClientSc
return closing(paginateQuery(groupsQuery, first, max).getResultStream() return closing(paginateQuery(groupsQuery, first, max).getResultStream()
.map(realm::getGroupById) .map(realm::getGroupById)
// In concurrent tests, the group might be deleted in another thread, therefore, skip those null values.
.filter(Objects::nonNull)
.sorted(GroupModel.COMPARE_BY_NAME) .sorted(GroupModel.COMPARE_BY_NAME)
); );
} }