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

Make flaky integration test less flaky #2838

Merged
merged 1 commit into from
Nov 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions services/galley/test/integration/API/Teams/Feature.hs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,10 @@ testSimpleFlagTTLOverride defaultValue ttl ttlAfter = do
checkTtl (FeatureTTLSeconds actualTtl) (FeatureTTLSeconds expectedTtl) =
assertBool
("expected the actual TTL to be greater than 0 and equal to or no more than 2 seconds less than " <> show expectedTtl <> ", but it was " <> show actualTtl)
(actualTtl > 0 && actualTtl <= expectedTtl && abs (actualTtl - expectedTtl) <= 2)
( actualTtl > 0
&& actualTtl <= expectedTtl
&& abs (fromIntegral @Word @Int actualTtl - fromIntegral @Word @Int expectedTtl) <= 2
)
checkTtl FeatureTTLUnlimited FeatureTTLUnlimited = pure ()
checkTtl FeatureTTLUnlimited _ = assertFailure "expected the actual TTL to be unlimited, but it was limited"
checkTtl _ FeatureTTLUnlimited = assertFailure "expected the actual TTL to be limited, but it was unlimited"
Expand All @@ -562,7 +565,7 @@ testSimpleFlagTTLOverride defaultValue ttl ttlAfter = do
-- Setting should work
setFlagInternal otherValue ttl
getFlag otherValue
getFeatureConfig otherValue ttl -- XXXXX
getFeatureConfig otherValue ttl
getFlagInternal otherValue

case (ttl, ttlAfter) of
Expand Down