-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Description
When a counter underflow is triggered, the real server responds with SUBDOC_DELTA_RANGE while the mock responds with SUBDOC_VALUE_CANTINSERT.
Here is the test case from core-io that triggers it:
@Test
public void shouldReturnDeltaRangeOnCounterDeltaUnderflow() {
String path = "counter";
long prepareUnderflow = -1L;
long delta = Long.MIN_VALUE;
//first request will bring the value to -1
SubCounterRequest request = new SubCounterRequest(testSubKey, path, prepareUnderflow, bucket());
SimpleSubdocResponse response = cluster().<SimpleSubdocResponse>send(request).toBlocking().single();
ReferenceCountUtil.releaseLater(response.content());
String result = response.content().toString(CharsetUtil.UTF_8);
assertEquals("-1", result);
//second request will underflow
request = new SubCounterRequest(testSubKey, path, delta, bucket());
response = cluster().<SimpleSubdocResponse>send(request).toBlocking().single();
ReferenceCountUtil.releaseLater(response.content());
result = response.content().toString(CharsetUtil.UTF_8);
assertEquals(result, 0, result.length());
assertEquals(ResponseStatus.SUBDOC_DELTA_RANGE, response.status());
}Metadata
Metadata
Assignees
Labels
No labels