- Issue created by @m.stenta
- Assigned to Shreya_98
- last update
about 1 year ago 21 pass - @shreya_th opened merge request.
- Issue was unassigned.
- Status changed to Needs review
about 1 year ago 7:55am 9 October 2023 - Status changed to Needs work
about 1 year ago 1:20pm 9 October 2023 - 🇺🇸United States m.stenta
Thank you for the merge request @Shreya_th! It looks like it fixes the issue and it makes sense.
I would still like to know *why* this is necessary, though. And why *isn't* it necessary in the other tests?
Why is there inconsistency in the order of results returned by
loadMultipl()
in the first place?My concern is that, even though this MR fixes the tests, will it start happening in the other tests in the future? I would like to understand the underlying logic before we apply any fixes, so that we can be confident that they are the right fixes long-term.
I wonder if this is a known behavior of Drupal core. Perhaps we can find another issue or documentation that describes the same behavior.
- First commit to issue fork.
- Open on Drupal.org →Core: 10.2.1 + Environment: PHP 8.2 & MySQL 8last update
6 months ago Waiting for branch to pass - Open on Drupal.org →Core: 10.2.1 + Environment: PHP 8.2 & MySQL 8last update
6 months ago Waiting for branch to pass - Open on Drupal.org →Core: 10.2.1 + Environment: PHP 8.2 & MySQL 8last update
6 months ago Waiting for branch to pass - 🇺🇸United States paul121 Spokane, WA
I updated the gitlab CI to run on multiple DBs inlcuding pgsql-13.5 and could reproduce this issue: https://git.drupalcode.org/project/log/-/pipelines/210166
Why is there inconsistency in the order of results returned by loadMultiple() in the first place?
Indeed this is weird. I wonder if it has to do with the order the logs are modified in the tests and postgres uses modified time as a default sort? But loadMultiple() actually returns an associative array with log IDs as the keys, so I'm not sure the order of the key/values in the array is guaranteed.
I've updated the tests so that the $timestamp arrays are keyed by the log IDs. I think this is a more explicit test anyways: we want to guarantee certain logs have certain timestamps, this code isn't responsible for returning logs in any particular order.
I'd like to merge these changes so that we can have tests running on multiple DBs (without failures!) What do you think @mstenta?
- Status changed to Needs review
6 months ago 9:54pm 27 June 2024 - 🇺🇸United States paul121 Spokane, WA
Oh, and I didn't change the other tests that use similar $timestamp arrays. In 🐛 Update owner of cloned logs to the current user Needs review I've actually refactored how these particular action tests work so they are simpler. But
LogActionsTest::testRescheduleMultipleLogsRelative()
is particularly complex and can still use this approach, I think :-) - Status changed to Postponed
5 months ago 2:39pm 15 July 2024 - 🇺🇸United States m.stenta
Postponing this until 2.x branch tests are passing again.
- Status changed to Needs review
5 months ago 4:18pm 15 July 2024 - 🇺🇸United States m.stenta
Nevermind! Tests are passing. I was confused by the old DrupalCI results still showing up. :-)
- Status changed to Needs work
5 months ago 7:33pm 17 July 2024 - 🇺🇸United States m.stenta
@paul121 I think this all makes sense - thanks!
One thought and one request:
- I wonder if there are any guidelines for database versions. By explicitly declaring them in
.gitlab-ci.yml
we are giving ourselves something else to maintain moving forward, which we didn't have before. Without this change, what are the defaults? And what would happen if this were run in a GitLab instance that's different from Drupal.org's? I assume this configuration is tightly tied to that instance? - The commit that fixes this issue should be called "Issue #3392223: LogActionsTest::testRescheduleMultipleLogsRelative() fails on PostgreSQL" (you can copy it from the "Credit and committing" section down below on this page). That's how we'll know how to find this discussion in the future if we need to from the commit messages.
- I wonder if there are any guidelines for database versions. By explicitly declaring them in
- 🇺🇸United States m.stenta
Without this change, what are the defaults?
Is it possible to declare the database types without declaring the versions, and fall back on whatever the default versions are in the GitLab instance? I assume that's what it's doing when we don't declare anything (and falls back on a version of MySQL or MariaDB)?
I acknowledge that it is better to declare specific versions. I'm just curious how it works so we can decide what makes sense.
- Status changed to Needs review
5 months ago 5:24am 18 July 2024 - 🇺🇸United States paul121 Spokane, WA
Without this change, what are the defaults? And what would happen if this were run in a GitLab instance that's different from Drupal.org's? I assume this configuration is tightly tied to that instance?
Yes, as I understand this template is very very tightly configured to the Drupal gitlab instance. I'm not sure what would happen if you ran this on another gitlab instance. From what I understand they have designed the template to "work out of the box" for the majority of drupal contrib modules & to always run on against latest Drupal core and default services. Depending on this template is so much less maintenance work than anything else we can do.
Though I see how database versions could create more work here but I'm not sure what we can do to avoid this. I followed the Drupal Gitlab CI template docs which links to these allowed images. In fact, I had first tried only specifying pgsql-13 and it failed because I wasn't specific enough (13.5 minor version is required). For pgsql 16 and mysql 8 it looks like they are maintaining a single major version of the image that will always use the latest minor release, but they don't have this for mariadb.
The commit that fixes this issue should be called "Issue #3392223: LogActionsTest::testRescheduleMultipleLogsRelative() fails on PostgreSQL" (you can copy it from the "Credit and committing" section down below on this page). That's how we'll know how to find this discussion in the future if we need to from the commit messages.
I just set the merge settings for this log project to use merge commit with semi linear history - is that OK? I think these descriptive commits are more valuable for describing how code is changing rather than just why. Or can we do this when we merge? Worrying about issue #s while working on PRs just makes things more confusing IMO
-
m.stenta →
committed 76d69c3c on 2.x authored by
paul121 →
Issue #3392223: LogActionsTest::testRescheduleMultipleLogsRelative()...
-
m.stenta →
committed 76d69c3c on 2.x authored by
paul121 →
- Status changed to Fixed
5 months ago 3:23pm 18 July 2024 Automatically closed - issue fixed for 2 weeks with no activity.