[Bug 2049502] Re: Flaky tests due to relying on default result ordering

Ubuntu Foundations Team Bug Bot 2049502 at bugs.launchpad.net
Tue Jan 16 16:18:37 UTC 2024


The attachment "golang-entgo-ent-0.11.3-4ubuntu1.diff" seems to be a
debdiff.  The ubuntu-sponsors team has been subscribed to the bug report
so that they can review and hopefully sponsor the debdiff.  If the
attachment isn't a patch, please remove the "patch" flag from the
attachment, remove the "patch" tag, and if you are member of the
~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by
~brian-murray, for any issue please contact him.]

** Tags added: patch

-- 
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:
  New

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