Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed Dec 11, 2024
1 parent d33a073 commit 183ee0f
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions tests/functional/ingestion/IngestionReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ describe.only('ingestion reader tests with mock', function fD() {
let batchState;
const sourceConfig = testConfig.extensions.ingestion.sources[0];

beforeEach(function(done) {
beforeEach(async () => {
batchState = {
logRes: null,
logStats: {
Expand All @@ -214,22 +214,29 @@ describe.only('ingestion reader tests with mock', function fD() {
timeoutMs: 1000,
logger: dummyLogger,
};

this.ingestionReader = new IngestionReader({
zkClient,
ingestionConfig: testConfig.extensions.ingestion,
kafkaConfig: testConfig.kafka,
bucketdConfig: testConfig.extensions.ingestion.sources[0],
bucketdConfig: sourceConfig,
qpConfig: testConfig.queuePopulator,
logger: dummyLogger,
extensions: [ingestionQP],
metricsProducer: { publishMetrics: () => { } },
s3Config: testConfig.s3,
producer,
});
this.ingestionReader.setup(err => {
if (err) {
return done(err);
}

await new Promise((resolve, reject) => {
this.ingestionReader.setup(err => {
if (err) return reject(err);
resolve();
});
});

// Perform additional setup steps
await new Promise((resolve, reject) => {
async.series([
next => setZookeeperInitState(this.ingestionReader, zkClient, next),
next => zkClient.setData(
Expand All @@ -242,16 +249,14 @@ describe.only('ingestion reader tests with mock', function fD() {
}
),
next => setupS3Mock(sourceConfig, next),
], err => {
if (err) {
return done(err);
}
done();
], (err) => {
if (err) return reject(err);
resolve();
});
});
});

afterEach(function(done) {
afterEach(async function(done) {
async.series([
next => emptyAndDeleteVersionedBucket(sourceConfig, next),
next => zkClient.remove(this.ingestionReader.pathToLogOffset, -1, next),
Expand Down

0 comments on commit 183ee0f

Please sign in to comment.