@Test
    public void testRetryVisitorOnTransientError() {
        MockComponents mc = createDefaultMock("id.user==1234");
        mc.visitorSession.start();
        mc.controlHandler.resetMock();
        mc.executor.expectAndProcessTasks(1);
        replyToCreateVisitor(mc.sender, (reply) -> {
            reply.addError(new Error(
                    DocumentProtocol.ERROR_ABORTED,
                    "bucket fell down a well"));
        });
        mc.executor.expectAndProcessTasks(1); // reply
        // Must have a 100ms delay
        mc.executor.expectAndProcessTasks(1, new long[] { 100 }); // send
        assertEquals("CreateVisitorMessage(buckets=[\n" +
                "BucketId(0x80000000000004d2)\n" +
                "BucketId(0x0000000000000000)\n" +
                "]\n" +
                "selection='id.user==1234'\n)",
                replyToCreateVisitor(mc.sender, ProgressToken.FINISHED_BUCKET));
        mc.executor.expectAndProcessTasks(1);
        mc.executor.expectNoTasks();
        assertTrue(mc.visitorSession.isDone());
        assertEquals("onVisitorError : ABORTED: bucket fell down a well\n" +
                "onProgress : 0 active, 0 pending, 1 finished, 1 total\n" +
                "onVisitorStatistics : 0 buckets visited, 0 docs returned\n" +
                "onDone : SUCCESS - ''\n",
                mc.controlHandler.toString());
    }
Test that different visitors within the same session get different
names.
documentapi/src/test/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSessionTestCase.java