An approved merge's first build passes the guard of a build through a verb, and a failed one is recorded (issues 1146, 1169) #387
@@ -104,15 +104,23 @@ func TestNatsTheSystemAccountsExportsReachMeshOnAReload(t *testing.T) { // 1147/
|
||||
}
|
||||
// Another user connects and disconnects: the watchman hears both, and the events name that user.
|
||||
gitea, _ := connect("one.gitea")
|
||||
// The server says each connection's own events too, the watchman's among them, and may say its connect after the
|
||||
// subscription is made (issue 1169): the event looked for is the one naming the other user, whatever comes before it.
|
||||
hears := func(ch chan *nats.Msg, what string) {
|
||||
t.Helper()
|
||||
select {
|
||||
case m := <-ch:
|
||||
if !strings.Contains(string(m.Data), "one.gitea") {
|
||||
t.Errorf("the %s event does not name the user that connected: %s", what, m.Data)
|
||||
bound := time.After(5 * time.Second)
|
||||
var others []string
|
||||
for {
|
||||
select {
|
||||
case m := <-ch:
|
||||
if strings.Contains(string(m.Data), "one.gitea") {
|
||||
return
|
||||
}
|
||||
others = append(others, string(m.Data))
|
||||
case <-bound:
|
||||
t.Errorf("the watchman did not hear another user's %s; it heard only %q", what, others)
|
||||
return
|
||||
}
|
||||
case <-time.After(5 * time.Second):
|
||||
t.Errorf("the watchman did not hear another user's %s", what)
|
||||
}
|
||||
}
|
||||
hears(connects, "connect")
|
||||
|
||||
Reference in New Issue
Block a user