test: e2eテストがCIで失敗していた問題をいくつか修正 (#8642)
* test: indexeddbをテスト毎に初期化するように * fix: metaが無いときにfetch-metaを同時に呼ぶと死ぬことがある問題を修正 * test: ログイン後のクライアント側処理を待たずにリロードされてログイン出来ないことがあったのを修正
This commit is contained in:
parent
4b872856c2
commit
22bb1a1793
2 changed files with 23 additions and 6 deletions
|
@ -20,9 +20,16 @@ export async function fetchMeta(noCache = false): Promise<Meta> {
|
|||
cache = meta;
|
||||
return meta;
|
||||
} else {
|
||||
const saved = await transactionalEntityManager.save(Meta, {
|
||||
id: 'x',
|
||||
}) as Meta;
|
||||
// metaが空のときfetchMetaが同時に呼ばれるとここが同時に呼ばれてしまうことがあるのでフェイルセーフなupsertを使う
|
||||
const saved = await transactionalEntityManager
|
||||
.upsert(
|
||||
Meta,
|
||||
{
|
||||
id: 'x',
|
||||
},
|
||||
['id'],
|
||||
)
|
||||
.then((x) => transactionalEntityManager.findOneByOrFail(Meta, x.identifiers[0]));
|
||||
|
||||
cache = saved;
|
||||
return saved;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue