Bug 33834: Fix random failure on api/v1/ill_requests.t
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 25 May 2023 13:15:08 +0000 (10:15 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 26 May 2023 12:50:04 +0000 (09:50 -0300)
commit1a8903ae850ca268c730e19c1b575e3be942ee2b
tree961eeb0de6596b486ccfee304c7046fa1a7d1ee4
parent816bbbe77f47688ee79f6664e60cc72ce5d7dd4a
Bug 33834: Fix random failure on api/v1/ill_requests.t

This patch makes the GET request results more deterministic so we avoid
random failures. It does so by adding a fixed value to each ILL request
and then sorting by it.

To test:
1. Run:
   $ DB_IMAGE=mysqli:8.0 ktd up -d
   # wait until it finished:
   $ ktd --logs
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/ill_requests.t
  (repeat a few times)
=> FAIL: It sometimes fails
3. Apply this patch
4. Repeat 2
=> SUCCESS: It doesn't fail
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
t/db_dependent/api/v1/ill_requests.t