mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-09 00:57:29 -06:00
[chore] Test fixes (#788)
* use 'test' value for testrig storage backend * update test dependency * add WaitFor func in testrig * use WaitFor function instead of time.Sleep * tidy up tests * make SentMessages a sync.map * go fmt
This commit is contained in:
parent
bee8458a2d
commit
0245c606d7
30 changed files with 501 additions and 222 deletions
|
|
@ -444,14 +444,15 @@ func (suite *InboxPostTestSuite) TestPostDelete() {
|
|||
suite.Empty(b)
|
||||
suite.Equal(http.StatusOK, result.StatusCode)
|
||||
|
||||
// sleep for a sec so side effects can process in the background
|
||||
time.Sleep(2 * time.Second)
|
||||
|
||||
// local account 2 blocked foss_satan, that block should be gone now
|
||||
testBlock := suite.testBlocks["local_account_2_block_remote_account_1"]
|
||||
dbBlock := >smodel.Block{}
|
||||
err = suite.db.GetByID(ctx, testBlock.ID, dbBlock)
|
||||
suite.ErrorIs(err, db.ErrNoEntries)
|
||||
if !testrig.WaitFor(func() bool {
|
||||
// local account 2 blocked foss_satan, that block should be gone now
|
||||
testBlock := suite.testBlocks["local_account_2_block_remote_account_1"]
|
||||
dbBlock := >smodel.Block{}
|
||||
err = suite.db.GetByID(ctx, testBlock.ID, dbBlock)
|
||||
return suite.ErrorIs(err, db.ErrNoEntries)
|
||||
}) {
|
||||
suite.FailNow("timed out waiting for block to be removed")
|
||||
}
|
||||
|
||||
// no statuses from foss satan should be left in the database
|
||||
dbStatuses, err := suite.db.GetAccountStatuses(ctx, deletedAccount.ID, 0, false, false, "", "", false, false, false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue