commenty-wenty

This commit is contained in:
tobi 2024-04-29 11:35:28 +02:00
parent 6a87d1148b
commit 0a4675f5ed
2 changed files with 10 additions and 9 deletions

View file

@ -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")

View file

@ -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