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

overlord: fix TestEnsureLoopPrune not to be so racy #3140

Merged
merged 5 commits into from Apr 5, 2017

Conversation

zyga
Copy link
Collaborator

@zyga zyga commented Apr 4, 2017

We are seeing many failures that involve the TestEnsureLoopPrune test.
This test is inherently racy as it uses a actual time to wait for
something to happen. In case the machine is loaded heavily and other
processes contend for resources it may not get scheduled in time for
this to happen

This branch contains (now) a more sophisticated approach suggested
and demonstrated by pedronis.

Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com

zyga added 4 commits April 4, 2017 16:56
We are seeing many failures that involve the TestEnsureLoopPrune test.
This test is inherently racy as it uses a actual time to wait for
something to happen. In case the machine is loaded heavily and other
processes contend for resources it may not get scheduled in time for
this to happen.

While the fix is not perfect I hope to at least decrease the frequency
of the failures. We may investigate a more correct fix where timing
would no longer be a factor if this is deemed insufficient.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
@zyga zyga changed the title overlord: increase prune test wait by x10 overlord: fix TestEnsureLoopPrune not to be so racy Apr 5, 2017
Copy link
Collaborator

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

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

Nice

@@ -370,11 +370,42 @@ func (ovs *overlordSuite) TestEnsureLoopPrune(c *C) {
chg1.AddTask(t1)
chg2 := st.NewChange("prune", "...")
chg2.SetStatus(state.DoneStatus)
t0 := chg2.SpawnTime()
Copy link
Collaborator

Choose a reason for hiding this comment

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

conceptually this needs to be ReadyTime(), my fault

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll fix this in a second.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
@pedronis pedronis merged commit 59472d2 into snapcore:master Apr 5, 2017
@zyga zyga deleted the fix-prune branch August 22, 2017 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants