mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-05-16 11:32:39 +00:00
commenty-wenty
This commit is contained in:
parent
6a87d1148b
commit
0a4675f5ed
|
@ -125,15 +125,7 @@ func (suite *FromClientAPITestSuite) checkStreamed(
|
|||
ctx, cncl := context.WithTimeout(ctx, time.Second*5)
|
||||
defer cncl()
|
||||
|
||||
var (
|
||||
msg stream.Message
|
||||
ok bool
|
||||
)
|
||||
|
||||
testrig.WaitFor(func() bool {
|
||||
msg, ok = str.Recv(ctx)
|
||||
return (expectMessage && ok) || (!expectMessage && !ok)
|
||||
})
|
||||
msg, ok := str.Recv(ctx)
|
||||
|
||||
if expectMessage && !ok {
|
||||
suite.FailNow("expected a message but message was not received")
|
||||
|
|
|
@ -54,6 +54,15 @@ type WorkersTestSuite struct {
|
|||
testListEntries map[string]*gtsmodel.ListEntry
|
||||
}
|
||||
|
||||
// TestStructs encapsulates structs needed to
|
||||
// run one test in this package. Each test should
|
||||
// call SetupTestStructs to get a new TestStructs,
|
||||
// and defer TearDownTestStructs to close it when
|
||||
// the test is complete. The reason for doing things
|
||||
// this way here is to prevent the tests in this
|
||||
// package from overwriting one another's processors
|
||||
// and worker queues, which was causing issues
|
||||
// when running all tests at once.
|
||||
type TestStructs struct {
|
||||
State *state.State
|
||||
Processor *processing.Processor
|
||||
|
|
Loading…
Reference in a new issue