mattermost-mobile-upstream/detox/e2e/support/classification_lock.ts
yasser khan ef1ecc1d9e
fix: stabilize server switch, saved posts, favorites, and related runtime races (#10122)
test(e2e): stabilize Detox and Maestro suites and harden CI

- Re-enable stabilized cases and document remaining iOS skips.
- Improve selectors, navigation recovery, state assertions, and retry limits.
- Harden API retries, fixture setup, and server configuration cleanup.
- Increase Detox shards to 24 and improve reporting, artifact uploads, and timeout handling.
- Add testIDs and unit-test fixes; revert unproven app behavior changes.
2026-09-09 00:35:15 +05:30

34 lines
1.2 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {createServerLock} from '@support/server_lock';
import type {AcquireLockOptions} from '@support/classification_lock_core';
const classificationLock = createServerLock('classification');
export const createClassificationLockOwner = (): string => {
return classificationLock.createOwner();
};
export const acquireClassificationLock = async (
baseUrl: string,
owner: string,
options: AcquireLockOptions = {},
): Promise<void> => {
return classificationLock.acquire(baseUrl, owner, options);
};
export const releaseClassificationLock = async (baseUrl: string, owner: string): Promise<void> => {
return classificationLock.release(baseUrl, owner);
};
/**
* Throw unless `owner` still holds the classification lock. Cheap (one admin-preference
* read): call it before config mutations and in beforeEach so a stolen lock fails the test
* immediately with the stealer's identity instead of as downstream banner timeouts.
*/
export const assertClassificationLockOwnership = async (baseUrl: string, owner: string): Promise<void> => {
return classificationLock.assertOwnership(baseUrl, owner);
};