Skip to content

Commit

Permalink
Fix flaky vault test. (#2422)
Browse files Browse the repository at this point in the history
(cherry picked from commit 93e44ff)
  • Loading branch information
vincentwschau authored and mergify[bot] committed Oct 1, 2024
1 parent 6005a0d commit e1bbba0
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import request from 'supertest';
import { getFixedRepresentation, sendRequest } from '../../../helpers/helpers';
import { DateTime } from 'luxon';
import Big from 'big.js';
import config from '../../../../src/config';

describe('vault-controller#V4', () => {
const latestBlockHeight: string = '25';
Expand All @@ -37,6 +38,7 @@ describe('vault-controller#V4', () => {
const vault1Equity: number = 159500;
const vault2Equity: number = 10000;
const mainVaultEquity: number = 10000;
const vaultPnlHistoryHoursPrev: number = config.VAULT_PNL_HISTORY_HOURS;

beforeAll(async () => {
await dbHelpers.migrate();
Expand All @@ -48,6 +50,8 @@ describe('vault-controller#V4', () => {

describe('GET /v1', () => {
beforeEach(async () => {
// Get a week of data for hourly pnl ticks.
config.VAULT_PNL_HISTORY_HOURS = 168;
await testMocks.seedData();
await perpetualMarketRefresher.updatePerpetualMarkets();
await liquidityTierRefresher.updateLiquidityTiers();
Expand Down Expand Up @@ -109,6 +113,7 @@ describe('vault-controller#V4', () => {

afterEach(async () => {
await dbHelpers.clearData();
config.VAULT_PNL_HISTORY_HOURS = vaultPnlHistoryHoursPrev;
});

it('Get /megavault/historicalPnl with no vault subaccounts', async () => {
Expand Down

0 comments on commit e1bbba0

Please sign in to comment.