You have been subscribed to a public bug:

TestRunBacklogFailedContinuesDiffApp fails with Go 1.5 like this:

kindpool_test.go:544:
    // Everything up to here was just set-up.
    //
    // What we're checking for is that, if a helper launch fails, the
    // next one in the backlog is picked up.
    c.Assert(takeNext(ch, c).Input.App, Equals, app1)
... obtained *click.AppId = &click.AppId{Package:"com.example.test", 
Application:"test-app-2", Version:"", Click:true, 
original:"com.example.test_test-app-2"} ("com.example.test_test-app-2")
... expected *click.AppId = &click.AppId{Package:"com.example.test", 
Application:"test-app-1", Version:"", Click:true, 
original:"com.example.test_test-app-1"} ("com.example.test_test-app-1")

This is a race. It's a bit confusing -- and I don't really understand
this code -- but it's something like this:

TestRunBacklogFailedContinuesDiffApp calls s.pool.Start(). This starts
pool.loop() in it's own goroutine (the "loop goroutine").

The test causes the "in, ok := <-pool.chIn" case of the select in loop
to be entered twice: the first time the loop goroutine calls handleOne
and the second time it just puts the input in backlog.

The test then calls "go s.fakeLauncher.done("0")". This winds up calling
pool.OneDone in a new goroutine. OneDone does two things relevant to
this bug: it calls "pool.chDone <- args.Input.App" and it calls
"pool.chOut <- res". The problem is that the loop goroutine is sitting
in a select on pool.chDone and pool.chIn, and if it gets to run before
OneDone does its second send, it will push the failure for app2 into
chOut before OneDone pushes the result for app1. Hence the race above!

It's possible to make this fail on 1.4 by putting a small sleep after
the send to chDone.

** Affects: ubuntu-push (Ubuntu)
     Importance: Undecided
     Assignee: Samuele Pedroni (pedronis)
         Status: New

-- 
TestRunBacklogFailedContinuesDiffApp is racy
https://bugs.launchpad.net/bugs/1483079
You received this bug notification because you are a member of Ubuntu Bugs, 
which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to