test: fix TestAccountImportCycle flake (#4381)

Add extra flushes to make test more precise and try to avoid timeouts

```
=== RUN   TestAccountImportCycle
    accounts_test.go:3447: require no error, but got: nats: timeout
--- FAIL: TestAccountImportCycle (1.01s)
```
This commit is contained in:
Neil
2023-08-09 11:39:52 +01:00
committed by GitHub

View File

@@ -3432,11 +3432,13 @@ func TestAccountImportCycle(t *testing.T) {
// setup requestor
ib := "q2.inbox"
subAResp, err := ncA.SubscribeSync(ib)
ncA.Flush()
require_NoError(t, err)
req := func() {
t.Helper()
// send request
err = ncA.PublishRequest("q1.a", ib, []byte("test"))
ncA.Flush()
require_NoError(t, err)
mRep, err := subAResp.NextMsg(time.Second)
require_NoError(t, err)