Source:
<code>public void noCrashOnCommittedRequestsOfUnSeenRequestTest() throws Exception { final String path = "/noCrash/OnCommittedRequests/OfUnSeenRequestTest"; <START> final int iteration = 10; <END> final int sessionid = 0x123456; final int firstCXid = 0x100; int readReqId = firstCXid; processor.stoppedMainLoop = true; HashSet<Request> localRequests = new HashSet<Request>(); Request firstCommittedReq = newRequest( new CreateRequest(path, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL.toFlag()), OpCode.create, sessionid, readReqId++); processor.queuedRequests.add(firstCommittedReq); localRequests.add(firstCommittedReq); for (; readReqId <= iteration+firstCXid; ++readReqId) { Request readReq = newRequest(new GetDataRequest(path, false), OpCode.getData, sessionid, readReqId); processor.queuedRequests.add(readReq); localRequests.add(readReq); } Assert.assertTrue(processor.queuedRequests.containsAll(localRequests)); processor.initThreads(iteration* 2); processor.run(); Assert.assertTrue(processedRequests.isEmpty()); Request preSessionCommittedReq = newRequest( new CreateRequest(path, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL.toFlag()), OpCode.create, sessionid, firstCXid - 2); processor.committedRequests.add(preSessionCommittedReq); processor.committedRequests.add(firstCommittedReq); processor.run(); Assert.assertTrue(processedRequests.peek() == preSessionCommittedReq); processor.run(); Assert.assertTrue(processedRequests.containsAll(localRequests)); }</code><technical_language>meaning of "iteration". is for loop for setting number of threads.. init number of threads in other tests? (it's relevant tested functionality)</technical_language>

Target:
public void noCrashOnCommittedRequestsOfUnSeenRequestTest() throws Exception { final String path = "/noCrash/OnCommittedRequests/OfUnSeenRequestTest"; final int numberofReads = 10; final int sessionid = 0x123456; final int firstCXid = 0x100; int readReqId = firstCXid; processor.stoppedMainLoop = true; HashSet<Request> localRequests = new HashSet<Request>(); Request firstCommittedReq = newRequest( new CreateRequest(path, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL.toFlag()), OpCode.create, sessionid, readReqId++); processor.queuedRequests.add(firstCommittedReq); localRequests.add(firstCommittedReq); for (; readReqId <= numberofReads+firstCXid; ++readReqId) { Request readReq = newRequest(new GetDataRequest(path, false), OpCode.getData, sessionid, readReqId); processor.queuedRequests.add(readReq); localRequests.add(readReq); } Assert.assertTrue(processor.queuedRequests.containsAll(localRequests)); processor.initThreads(numberofReads* 2); processor.run(); Assert.assertTrue(processedRequests.isEmpty()); Request preSessionCommittedReq = newRequest( new CreateRequest(path, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL.toFlag()), OpCode.create, sessionid, firstCXid - 2); processor.committedRequests.add(preSessionCommittedReq); processor.committedRequests.add(firstCommittedReq); processor.run(); Assert.assertTrue(processedRequests.peek() == preSessionCommittedReq); processor.run(); Assert.assertTrue(processedRequests.containsAll(localRequests)); }