message: add simple hilo next range test
diff: @@ -219,4 +219,31 @@ describe("HiLo", function () {
  assert.ok(parseInt(numericPart, 10) < 33);
  });
  });
  +
  + it("does get another range when gets over max and leaves no gaps", async () => {
  + const parallelLevel = 40;
  + const users = Array.from(Array(parallelLevel).keys()).map(x => new User());
  +
  + const tasks = Array.from(Array(parallelLevel).keys()).map(async i => {
  + const user = users[i];
  + const session = store.openSession();
  + await session.store(user);
  + await session.saveChanges();
  + });
  +
  + await Promise.all(tasks);
  +
  + const idNumbers = users
  + .map(x => x.id)
  + .map(id => id.split("/")[1])
  + .map(x => parseInt(x.split("-")[0], 10));
  +
  + assert.strictEqual(idNumbers.length, 40);
  +
  + idNumbers.sort((a, b) => a > b ? 1 : -1);
  +
  + for (let i = 1; i <= 40; i++) {
  + assert.strictEqual(idNumbers[i - 1], i);
  + }
  + });
  });
  