Skip to content

Fix race condition in an async test which was triggering failures (SR-2332) #156

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

Merged
merged 1 commit into from
Aug 16, 2016

Conversation

briancroom
Copy link
Contributor

When the system running these tests is under load, the assumptions that these tests were making about dates and ordering weren't holding. This could cause test_immediatelyTrueDelayedFalsePredicateAndObject_passes to fail intermittently, and test_delayedTruePredicateAndObject_passes to not be verifying the situation it was written to target.

This removes these tests' dependency on dates, increasing reliability.

Resolves: https://bugs.swift.org/browse/SR-2332

@mike-ferris-apple @parkera

@briancroom
Copy link
Contributor Author

@swift-ci please test and merge

@briancroom
Copy link
Contributor Author

@swift-ci Please test

@modocache
Copy link
Contributor

Awesome, thanks @briancroom! Do you think similar changes need to be made for other similar async tests, such as this one?

@mike-ferris
Copy link

I agree that the technique in this diff might be good to use in other places where we're relying on dates and timing to test similar stuff.

The specific test you reference seems less likely to be an issue immediately because of the different time values involved, though it does seem the same theoretical issues could be avoided with the same sort of technique.

Assuming the tests pass, though, let's get this merged.

@modocache modocache merged commit da05279 into swiftlang:master Aug 16, 2016
@modocache
Copy link
Contributor

Our tests seemed to have passed, so in it goes. We'll need to pick this change into swift-3.0-branch.

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.

3 participants