Skip to content

Commit e7e93b4

Browse files
Remove messy Destroy test clean-up in TestPartialStateJoin (#895)
Follow-up to #894 which removes another part of the clean-up code in this file and #880 which introduces a better way to avoid the test pollution and obsoletes the need for all of this cleanup logic. See the PR description there for a more complete context on why. `Destroy(...)` was originally introduced in this context: > Since the partial state join tests reuse the same homeserver deployment, it is important that each test leaves the homeserver in an acceptable state for subsequent tests. In particular, we must allow in-progress partial-state joins to complete before tearing down Complement servers, otherwise the homeserver may mark Complement `hostname:port` combinations as offline and refuse to contact them in subsequent tests. > > *-- #570 But thanks to #880 we no longer use the same `hostname:port` for engineered homeservers anymore. --- Given the nature of these changes, this also fixes the goroutine panic that can happen when the waiter finishes after the test and `t` is used after the test finishes, see #894 (comment)
1 parent 093a6cb commit e7e93b4

2 files changed

Lines changed: 88 additions & 108 deletions

File tree

helpers/waiter.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ func (w *Waiter) Waitf(t ct.TestLike, timeout time.Duration, errFormat string, a
4747
}
4848
}
4949

50+
// Done returns a channel which is closed when Finish is called. It can be used
51+
// in `select` statements where failing the test on a timeout (as Wait does) is
52+
// not appropriate. Prefer `Wait`/`Waitf` otherwise.
53+
func (w *Waiter) Done() <-chan bool {
54+
return w.ch
55+
}
56+
5057
// Finish will cause all goroutines waiting via Wait to stop waiting and return.
5158
// Once this function has been called, subsequent calls to Wait will return immediately.
5259
// To begin waiting again, make a new Waiter.

0 commit comments

Comments
 (0)