Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(2985) Order activity comments exported in budget CSV #2270

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

CristinaRO
Copy link
Contributor

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 before programme_activity_comment_2. If this ordering is not guaranteed, and programme_activity_comment_2 ends up with a created_at older than programme_activity_comment_1's created_at, then the fix may not make a difference.

Screenshots of UI changes

N/A

Next steps

  • Is an ADR required? An ADR should be added if this PR introduces a change to the architecture.
  • Is a changelog entry required? An entry should always be made in CHANGELOG.md, unless this PR is a small tweak which has no impact outside the development team.
  • Do any environment variables need amending or adding?
  • Have any changes to the XML been checked with the IATI validator? See XML Validation

@CristinaRO
Copy link
Contributor Author

1 similar comment
@CristinaRO
Copy link
Contributor Author

@CristinaRO CristinaRO force-pushed the 2985-flaky-spec-level-b-budget-comments branch from 47d1cf4 to 870afa5 Compare November 30, 2023 18:56
@CristinaRO CristinaRO requested a review from mec December 1, 2023 11:13
Copy link
Contributor

@mec mec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always thought the default order was by the record ID and becuase we use UUID, it looks random?

@CristinaRO CristinaRO enabled auto-merge December 4, 2023 12:17
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 before
`programme_activity_comment_2`. If *this* ordering is not guaranteed,
and `programme_activity_comment_2` ends up with a `created_at` older
than `programme_activity_comment_1`'s created_at, then the fix may not
make a difference.
@dxw-rails-user dxw-rails-user force-pushed the 2985-flaky-spec-level-b-budget-comments branch from 870afa5 to ddf533a Compare December 4, 2023 12:17
@CristinaRO CristinaRO merged commit 0217077 into develop Dec 4, 2023
@CristinaRO CristinaRO deleted the 2985-flaky-spec-level-b-budget-comments branch December 4, 2023 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants