Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/Fix-Concurrent-Modification-Exce…
Browse files Browse the repository at this point in the history
…ption-Default-Channel' into Fix-Concurrent-Modification-Exception-Default-Channel

# Conflicts:
#	sdk/appcenter/src/test/java/com/microsoft/appcenter/channel/DefaultChannelTest.java
  • Loading branch information
shadyabarada committed Dec 20, 2022
2 parents dc04a76 + a8a1d3a commit ca4c478
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -1202,14 +1202,14 @@ public void testConcurrentIterableDataStructureUpdatesSuccess() {
AppCenterIngestion mockIngestion = mock(AppCenterIngestion.class);
Channel.GroupListener mockListener = mock(Channel.GroupListener.class);

//Get the concurrent hashmap in DefaultChannel that accepts modifications during iteration
// Get the concurrent hashmap in DefaultChannel that accepts modifications during iteration.
DefaultChannel channel = new DefaultChannel(mock(Context.class), UUID.randomUUID().toString(), mockPersistence, mockIngestion, mAppCenterHandler);
Map<String, DefaultChannel.GroupState> myMap = channel.getGroupStates();
channel.addGroup(TEST_GROUP, 50, BATCH_TIME_INTERVAL, MAX_PARALLEL_BATCHES, null, mockListener);
channel.addGroup(TEST_GROUP_TWO, 50, BATCH_TIME_INTERVAL, MAX_PARALLEL_BATCHES, null, mockListener);
channel.addGroup(TEST_GROUP_THREE, 50, BATCH_TIME_INTERVAL, MAX_PARALLEL_BATCHES, null, mockListener);

//Iterate over the map and modify twice
// Iterate over the map and modify twice.
Iterator iterator = myMap.keySet().iterator();
while (iterator.hasNext()) {
String key = iterator.next().toString();
Expand Down

0 comments on commit ca4c478

Please sign in to comment.