[Bug 2049502] Re: Flaky tests due to relying on default result ordering
Simon Quigley
2049502 at bugs.launchpad.net
Tue Jan 16 16:50:26 UTC 2024
Sponsoring to Ubuntu with some minor nitpicks. Please ping me (on IRC)
if you don't hear anything on the Debian bug in the next 7 days, I can
NMU there.
Thanks!
** Changed in: golang-entgo-ent (Ubuntu)
Status: New => Fix Committed
--
You received this bug notification because you are a member of Ubuntu
Sponsors, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/2049502
Title:
Flaky tests due to relying on default result ordering
Status in golang-entgo-ent package in Ubuntu:
Fix Committed
Bug description:
A test of the golang test suite of ent is sometimes failing because
the results fetched from the database are not sorted as expected.
681s === RUN Example_M2M2Types
681s --- FAIL: Example_M2M2Types (0.00s)
681s got:
681s [Group(id=2, name=GitLab) Group(id=1, name=GitHub)]
681s [Group(id=1, name=GitHub)]
681s [User(id=1, age=30, name=a8m) User(id=2, age=28, name=nati)]
681s want:
681s [Group(id=1, name=GitHub) Group(id=2, name=GitLab)]
681s [Group(id=1, name=GitHub)]
681s [User(id=1, age=30, name=a8m) User(id=2, age=28, name=nati)]
By default sqlite does not guaranty results ordering but this can go
unnoticed on simple cases. I suspect some race condition somewhere is
triggering the bug and the 2 results are swapped.
To make it reliable we need to explicitly call .Order(ent.Asc("id")).
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/golang-entgo-ent/+bug/2049502/+subscriptions
More information about the Ubuntu-sponsors
mailing list