Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky vault test. #2422

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading