Skip to content

Commit

Permalink
Deflake backup test by sleeping more..
Browse files Browse the repository at this point in the history
  • Loading branch information
kegsay committed Jan 10, 2024
1 parent d66d588 commit 713de5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion internal/api/js.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,10 @@ func (c *JSClient) MustBackupKeys(t *testing.T) (recoveryKey string) {
if err != nil {
fatalf(t, "MustBackupKeys: %s", err)
}
time.Sleep(time.Second)
// the backup loop which sends keys will wait between 0-10s before uploading keys...
// See https://github.com/matrix-org/matrix-js-sdk/blob/49624d5d7308e772ebee84322886a39d2e866869/src/rust-crypto/backup.ts#L319
// Ideally this would be configurable..
time.Sleep(11 * time.Second)
return *key
}

Expand Down
4 changes: 2 additions & 2 deletions tests/key_backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/matrix-org/complement/must"
)

// TODO: client types should be bob 1 and bob 2, NOT alice who is just used to send an encrypted msg.
// This allows us to test that backups made on FFI can be read on JS and vice versa.
// Test that backups can be created and stored in secret storage.
// Test that backups can be restored using secret storage and the recovery key.
func TestCanBackupKeys(t *testing.T) {
ClientTypeMatrix(t, func(t *testing.T, clientTypeA, clientTypeB api.ClientType) {
if clientTypeB.Lang == api.ClientTypeJS {
Expand Down

0 comments on commit 713de5e

Please sign in to comment.