From 0a4675f5ed76bde88dabe13dcadba0a3bd986fa5 Mon Sep 17 00:00:00 2001 From: tobi Date: Mon, 29 Apr 2024 11:35:28 +0200 Subject: [PATCH] commenty-wenty --- internal/processing/workers/fromclientapi_test.go | 10 +--------- internal/processing/workers/workers_test.go | 9 +++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/internal/processing/workers/fromclientapi_test.go b/internal/processing/workers/fromclientapi_test.go index af1e02907..c7c6e5c27 100644 --- a/internal/processing/workers/fromclientapi_test.go +++ b/internal/processing/workers/fromclientapi_test.go @@ -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") diff --git a/internal/processing/workers/workers_test.go b/internal/processing/workers/workers_test.go index a8562ea4f..5e2a78bb6 100644 --- a/internal/processing/workers/workers_test.go +++ b/internal/processing/workers/workers_test.go @@ -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