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

Fix random integration test failure due to timestamp roll over #224

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

mneudert
Copy link
Member

Description:

After #218 there is a second test that randomly fails due to a roll over in a timestamp:

1) Piwik\Plugins\QueuedTracking\tests\Integration\QueueTest::test_internalBuildRequestsSet_ShouldBeAbleToSpecifyTheSiteId
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
         'isAuthenticated' => null
         'isEmptyRequest' => false
         'tokenAuth' => false
-        'timestamp' => 1695759228
+        'timestamp' => 1695759229
         'requestMetadata' => Array ()
         'customTimestampDoesNotRequireTokenauthWhenNewerThan' => 86400
     )

/home/runner/work/matomo/matomo/matomo/plugins/QueuedTracking/tests/Integration/QueueTest.php:92

Resetting the timestamp as in aforementioned PR should solve that issue.

The second changed test is more a preventive measure. Using assertManyRequestSetsAreEqual (and the nested assertRequestsAreEqual) should take care of minute differences in timestamps.

Review

Copy link
Contributor

@snake14 snake14 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thank you

@snake14 snake14 merged commit 0f2a1c7 into 5.x-dev Sep 27, 2023
5 checks passed
@snake14 snake14 deleted the timestamp-test-fix branch September 27, 2023 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants