ci: Fix flaky tests (#8468)
This commit is contained in:
@@ -348,7 +348,7 @@ describe('Auth Adapter features', () => {
|
||||
it('should strip out authData if required', async () => {
|
||||
const spy = spyOn(modernAdapter3, 'validateOptions').and.callThrough();
|
||||
const afterSpy = spyOn(modernAdapter3, 'afterFind').and.callThrough();
|
||||
await reconfigureServer({ auth: { modernAdapter3 }, silent: false });
|
||||
await reconfigureServer({ auth: { modernAdapter3 } });
|
||||
const user = new Parse.User();
|
||||
await user.save({ authData: { modernAdapter3: { id: 'modernAdapter3Data' } } });
|
||||
await user.fetch({ sessionToken: user.getSessionToken() });
|
||||
|
||||
@@ -45,10 +45,6 @@ describe('Idempotency', () => {
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = process.env.PARSE_SERVER_TEST_TIMEOUT || 10000;
|
||||
});
|
||||
|
||||
// Tests
|
||||
it('should enforce idempotency for cloud code function', async () => {
|
||||
let counter = 0;
|
||||
|
||||
@@ -6,6 +6,7 @@ if (process.env.PARSE_SERVER_TEST_CACHE === 'redis') {
|
||||
});
|
||||
it('can connect', async () => {
|
||||
await reconfigureServer({
|
||||
appId: 'redis_live_query',
|
||||
startLiveQueryServer: true,
|
||||
liveQuery: {
|
||||
classNames: ['TestObject'],
|
||||
@@ -36,6 +37,7 @@ if (process.env.PARSE_SERVER_TEST_CACHE === 'redis') {
|
||||
|
||||
it('can call connect twice', async () => {
|
||||
const server = await reconfigureServer({
|
||||
appId: 'redis_live_query',
|
||||
startLiveQueryServer: true,
|
||||
liveQuery: {
|
||||
classNames: ['TestObject'],
|
||||
|
||||
@@ -115,6 +115,7 @@ describe('ParseLiveQueryServer', function () {
|
||||
});
|
||||
|
||||
describe_only_db('mongo')('initialization', () => {
|
||||
beforeEach(() => reconfigureServer({ appId: 'mongo_init_test' }));
|
||||
it('can be initialized through ParseServer without liveQueryServerOptions', async () => {
|
||||
const parseServer = await ParseServer.startApp({
|
||||
appId: 'hello',
|
||||
|
||||
@@ -198,6 +198,10 @@ beforeAll(async () => {
|
||||
Parse.serverURL = 'http://localhost:' + port + '/1';
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = process.env.PARSE_SERVER_TEST_TIMEOUT || 10000;
|
||||
});
|
||||
|
||||
afterEach(function (done) {
|
||||
const afterLogOut = async () => {
|
||||
if (Object.keys(openConnections).length > 0) {
|
||||
@@ -214,6 +218,7 @@ afterEach(function (done) {
|
||||
done();
|
||||
};
|
||||
Parse.Cloud._removeAllHooks();
|
||||
Parse.CoreManager.getLiveQueryController().setDefaultLiveQueryClient();
|
||||
defaults.protectedFields = { _User: { '*': ['email'] } };
|
||||
databaseAdapter
|
||||
.getAllClasses()
|
||||
|
||||
@@ -558,7 +558,7 @@ describe('server', () => {
|
||||
});
|
||||
|
||||
it('can get starting state', async () => {
|
||||
await reconfigureServer({ appId: 'test2', silent: false });
|
||||
await reconfigureServer({ appId: 'test2' });
|
||||
const parseServer = new ParseServer.ParseServer({
|
||||
...defaultConfiguration,
|
||||
appId: 'test2',
|
||||
|
||||
Reference in New Issue
Block a user