Commit aa5259b
Order the recipients of the instructor email digests
The query which picks the instructors to email had no `ORDER BY`, so
Postgres returned the rows in whatever physical order it found them in,
which depends on what else had been written to `user` before.
That made `test_it_sends_digests_for_instructors` pass or fail by luck: it
asserts the calls come out sorted by `h_userid`, which only held when the
heap happened to be laid out that way. The unit tests all share one
database (`tox.ini` points every worker at `lms_tests`) and run under
`--dist loadgroup`, so which tests a worker picks up — and therefore what
was written to `user` first — depends on the collected test list. Adding
the two dashboard API tests in this branch was enough to reshuffle it and
turn the test red, with no change to the code it covers.
Ordering in the query rather than in the test also makes the order the
digests go out in deterministic in production, which it was not.1 parent 2c03362 commit aa5259b
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
103 | 112 | | |
104 | 113 | | |
105 | 114 | | |
| |||
0 commit comments