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

tests: actually have TestSessionTTLRenew sleep during execution #5669

Merged
merged 2 commits into from
Apr 17, 2019

Conversation

rboyer
Copy link
Member

@rboyer rboyer commented Apr 16, 2019

Due to an unintended order of operations issue with integer division
TestSessionTTLRenew was sleeping for 0s every time.

Also add explicit failures for when the various session requests return
nil unexpectedly.

Due to an unintended order of operations issue with integer division
TestSessionTTLRenew was sleeping for 0s every time.

Also add explicit failures for when the various session requests return
nil unexpectedly.
@rboyer rboyer requested a review from a team April 16, 2019 15:00
@@ -397,14 +400,21 @@ func TestSessionTTLRenew(t *testing.T) {
}

// Sleep to consume some time before renew
time.Sleep(ttl * (structs.SessionTTLMultiplier / 3))
sleepFor := ttl * structs.SessionTTLMultiplier / 3
Copy link
Member Author

Choose a reason for hiding this comment

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

Previously this worked out to be ttl * (2 / 3) => ttl * (0) => 0

agent/session_endpoint_test.go Outdated Show resolved Hide resolved
agent/session_endpoint_test.go Outdated Show resolved Hide resolved
agent/session_endpoint_test.go Outdated Show resolved Hide resolved
@rboyer rboyer requested a review from freddygv April 17, 2019 20:47
Copy link
Contributor

@freddygv freddygv left a comment

Choose a reason for hiding this comment

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

🚢 🇮🇹

@rboyer rboyer merged commit 6269d1f into master Apr 17, 2019
@rboyer rboyer deleted the make-renew-tests-sleep branch April 17, 2019 20:52
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.

None yet

2 participants