Assert a re-used sequence number ends the hold it replaced
Mirror / push (push) Has been cancelled
Test / test (20) (pull_request) Successful in 32s
Test / test (22) (pull_request) Successful in 33s
Test / test (26) (pull_request) Successful in 32s
Test / test (18) (pull_request) Successful in 32s
Test / test (24) (pull_request) Successful in 32s
Test / lint (pull_request) Failing after 14m40s
Mirror / push (push) Has been cancelled
Test / test (20) (pull_request) Successful in 32s
Test / test (22) (pull_request) Successful in 33s
Test / test (26) (pull_request) Successful in 32s
Test / test (18) (pull_request) Successful in 32s
Test / test (24) (pull_request) Successful in 32s
Test / lint (pull_request) Failing after 14m40s
This commit is contained in:
@@ -1526,14 +1526,15 @@ describe('held message bounds', () => {
|
|||||||
test('is full at its count, and a re-used sequence number replaces rather than adding', () => {
|
test('is full at its count, and a re-used sequence number replaces rather than adding', () => {
|
||||||
const held = new HeldMessages({ log: silentLog, max: 2, maxOctets: 1_000_000, timeout: 10_000 });
|
const held = new HeldMessages({ log: silentLog, max: 2, maxOctets: 1_000_000, timeout: 10_000 });
|
||||||
const first = offer(held, 1);
|
const first = offer(held, 1);
|
||||||
|
const replaced = offer(held, 2);
|
||||||
|
|
||||||
offer(held, 2);
|
|
||||||
offer(held, 2);
|
offer(held, 2);
|
||||||
|
|
||||||
assert.equal(held.size, 2);
|
assert.equal(held.size, 2);
|
||||||
assert.equal(held.octetsHeld, 2 * 1026, 'the replaced message leaves its octets with it');
|
assert.equal(held.octetsHeld, 2 * 1026, 'the replaced message leaves its octets with it');
|
||||||
assert.equal(held.full(), true);
|
assert.equal(held.full(), true);
|
||||||
assert.equal(first.isHeld(), true);
|
assert.equal(first.isHeld(), true);
|
||||||
|
assert.equal(replaced.isHeld(), false);
|
||||||
|
|
||||||
held.clear();
|
held.clear();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user