@Test
    void testTraceInvocationsUnfillableHits() {
        final int traceLevel = 5;
        Query query = new Query("?trace.level=" + traceLevel);
        Chain<Searcher> forkingChain = new Chain<>(new Tracer("tracer1"),
                new Tracer("tracer2"),
                new Backend("backend1", false));
        Execution execution = new Execution(forkingChain, Execution.Context.createContextStub());
        Result result = execution.search(query);
        execution.fill(result, "mySummary");

        Iterator<String> trace = collectTrace(query).iterator();
        assertEquals("(level start)", trace.next());
        assertEquals("  No query profile is used", trace.next());
        trace.next(); // (properties trace: not checked)
        assertEquals("  (level start)", trace.next());
        assertEquals("    Invoke searcher 'tracer1'", trace.next());
        assertEquals("    During tracer1: 0", trace.next());
        assertEquals("    Invoke searcher 'tracer2'", trace.next());
        assertEquals("    During tracer2: 0", trace.next());
        assertEquals("    Invoke searcher 'backend1'", trace.next());
        assertEquals("    Return searcher 'backend1'", trace.next());
        assertEquals("    Return searcher 'tracer2'", trace.next());
        assertEquals("    Return searcher 'tracer1'", trace.next());
        assertEquals("    Invoke fill(mySummary) on searcher 'tracer1'", trace.next());
        assertEquals("    Ignoring fill(mySummary): Hits are unfillable: result.hits().getFilled()=null", trace.next());
        assertEquals("    Return fill(mySummary) on searcher 'tracer1'", trace.next());
        assertEquals("  (level end)", trace.next());
        assertEquals("(level end)", trace.next());
        assertFalse(trace.hasNext());
    }
Tests tracing scenarios where traces from multiple executions over the same query are involved.

@author bratseth
container-search/src/test/java/com/yahoo/search/searchchain/test/TraceTestCase.java