Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix DoctrineDriverTest random failures #155

Merged
merged 1 commit into from
Sep 26, 2013
Merged

Fix DoctrineDriverTest random failures #155

merged 1 commit into from
Sep 26, 2013

Conversation

eugene-dounar
Copy link

Do not compare "created" timestamps of class metadata as it may fail test on
busy CPU

@eugene-dounar
Copy link
Author

Test failed when Travis checked #154
https://travis-ci.org/schmittjoh/serializer/jobs/11485554

@eugene-dounar
Copy link
Author

Rebased on latest master so test pass

@@ -92,6 +92,9 @@ public function testNonDoctrineEntityClassIsNotModified()
$plainMetadata = $this->getAnnotationDriver()->loadMetadataForClass($refClass);
$doctrineMetadata = $this->getDoctrineDriver()->loadMetadataForClass($refClass);

// Do not compare timestamps
$plainMetadata->createdAt = $doctrineMetadata->createdAt;
Copy link
Owner

Choose a reason for hiding this comment

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

If this really is a problem, I'd prefer something that checks that the timestamps are equal within a few seconds, f.e. abs($timestamp1 - $timestamp2) < 5.

Copy link
Author

Choose a reason for hiding this comment

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

Yep, I saw tests fail twice - on Travis and my own laptop. So it's worth fixing.

Do not compare "created" timestamps of class metadata as it may fail
test on busy CPU
schmittjoh added a commit that referenced this pull request Sep 26, 2013
@schmittjoh schmittjoh merged commit ad2153e into schmittjoh:master Sep 26, 2013
@schmittjoh
Copy link
Owner

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants