Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed May 13, 2024
1 parent b5e9d1d commit 67f3468
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/functional/countItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ const cluster = require('cluster');
const async = require('async');
const werelogs = require('werelogs');
const { BucketInfo, ObjectMD } = require('arsenal').models;
const { constants } = require('arsenal');
const { constants, network } = require('arsenal');
const S3UtilsMongoClient = require('../../utils/S3UtilsMongoClient');

const CountMaster = require('../../CountItems/CountMaster');
const CountManager = require('../../CountItems/CountManager');
const createMongoParams = require('../../utils/createMongoParams');
const monitoring = require('../../utils/monitoring');
const createWorkers = require('../../CountItems/utils/createWorkers');
const {
testBucketMD, testAccountCanonicalId, testBucketCreationDate, testUserBucketInfo,
Expand All @@ -17,6 +18,7 @@ const logger = new werelogs.Logger('CountItems::Test::Functional');
const { MONGODB_REPLICASET } = process.env;
const dbName = 'countItemsTest';
const USERSBUCKET = '__usersbucket';
const WebServer = network.http.server;

const expectedCountItems = {
objects: 90,
Expand Down Expand Up @@ -190,6 +192,7 @@ jest.setTimeout(120000);
describe('CountItems', () => {
const oldEnv = process.env;
let client;
const metricServer = new WebServer(8003, logger);

beforeAll(done => {
process.env = oldEnv;
Expand Down Expand Up @@ -233,8 +236,18 @@ describe('CountItems', () => {
maxConcurrent: 5,
}),
client: new S3UtilsMongoClient(createMongoParams(logger)),
metrics: metricServer,
});

metricServer.onRequest((req, res) => monitoring.metricsHandler(
countMaster,
() => {
process.exit(1);
},
req,
res,
));

async.series([
next => countMaster.start(err => {
expect(err).toBeFalsy();
Expand Down

0 comments on commit 67f3468

Please sign in to comment.