(2985) Order activity comments exported in budget CSV #2270
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes in this PR
PostgreSQL doesn't guarantee an order for records unless we specify an ordering criterion ourselves. It is likely that the records will be returned with the most recently updated last, which is why the spec only fails occasionally.
This is potentially the cause of the budget spec failing sometimes.
Specifying the order in which the comments are returned will fix the intermittent failures, if they were caused by the unpredictable ordering coming from the database.
If, on the other hand, the intermittent errors are caused by some randomness in how the test objects are created[1], we may see failures again sometimes.
[1]
programme_activity_comment_1
should be created beforeprogramme_activity_comment_2
. If this ordering is not guaranteed, andprogramme_activity_comment_2
ends up with acreated_at
older thanprogramme_activity_comment_1
's created_at, then the fix may not make a difference.Screenshots of UI changes
N/A
Next steps
CHANGELOG.md
, unless this PR is a small tweak which has no impact outside the development team.