Skip to content

Commit

Permalink
Fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
foster33 committed Jun 28, 2024
1 parent c4132cf commit 5abc8fd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ public ResultsPage next() throws Exception {
log.info("Returning page of results");
// we have results!
// we also indicate whether we returned less than the requested page size in the response
return new ResultsPage(resultList, ((iter.hasNext() && numResults < this.maxResults && currentPageCount < maxPageSize) || hitIntermediateResult
return new ResultsPage(resultList, ((hasNext.get() > 0 && numResults < this.maxResults && currentPageCount < maxPageSize) || hitIntermediateResult
|| hitShortCircuitForLongRunningQuery) ? ResultsPage.Status.PARTIAL : ResultsPage.Status.COMPLETE);
} else {
// we have no results. Let us determine whether we are done or not.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ public void testNext_HappyPathUsingDeprecatedConstructor() throws Exception {
expect(this.transformIterator.next()).andReturn(iterator.next());
expect(this.transformIterator.getTransformer()).andReturn(transformer);
}
expect(this.transformIterator.hasNext()).andReturn(iterator.hasNext());
expect(this.query.getPagesize()).andReturn(pageSize).anyTimes();
expect(this.queryLogic.getMaxPageSize()).andReturn(maxPageSize).anyTimes();
expect(this.queryLogic.getPageByteTrigger()).andReturn(pageByteTrigger).anyTimes();
Expand Down Expand Up @@ -266,7 +265,6 @@ public void testNextMaxResults_HappyPathUsingDeprecatedConstructor() throws Exce
expect(this.transformIterator.next()).andReturn(iterator.next());
count++;
}
expect(this.transformIterator.hasNext()).andReturn(iterator.hasNext());
expect(this.transformIterator.getTransformer()).andReturn(transformer).times(count);

expect(this.query.getPagesize()).andReturn(pageSize).anyTimes();
Expand Down Expand Up @@ -481,7 +479,6 @@ public void testNextWithDnResultLimit_HappyPathUsingDeprecatedConstructor() thro
expect(this.transformIterator.next()).andReturn(iterator.next());
count++;
}
expect(this.transformIterator.hasNext()).andReturn(iterator.hasNext());
// now that the results thread is separate from the running query thread, we could continue getting stuff
expect(this.transformIterator.getTransformer()).andReturn(transformer).anyTimes();
expect(this.transformIterator.hasNext()).andReturn(iterator.hasNext()).anyTimes();
Expand Down

0 comments on commit 5abc8fd

Please sign in to comment.