Skip to content

Commit

Permalink
Fixed the test that was intermittently failing. Added await
Browse files Browse the repository at this point in the history
  • Loading branch information
tkmcmaster committed Mar 26, 2024
1 parent 94234df commit 39c7a31
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions controller/test/pewpew.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ describe("PewPew Util", () => {
const versionInUse = "0.1.1";
let testIdInUse: string | undefined;

before(() => {
before(async () => {
const yamlFile = "unittest.yaml";
const { testId, s3Folder } = PpaasTestId.makeTestId(yamlFile);
const testScheduler = new Map<string, TestSchedulerItem>();
Expand All @@ -313,7 +313,7 @@ describe("PewPew Util", () => {
token: "user1token",
userId: "user1"
};
TestSchedulerIntegration.addTest({
await TestSchedulerIntegration.addTest({
queueName: "bogus",
scheduleDate: Date.now() + 600000,
testMessage: {
Expand All @@ -326,6 +326,11 @@ describe("PewPew Util", () => {
}
}, authUser1);
testIdInUse = testId;
const foundInUse = await TestSchedulerIntegration.getTestIdsForPewPewVersion(versionInUse);
log("scheduledTests", LogLevel.DEBUG, global.scheduledTests);
expect(foundInUse, "foundInUse").to.not.equal(undefined);
expect(foundInUse?.length, "foundInUse.length").to.equal(1);
expect(foundInUse![0], "foundInUse[0]").to.equal(testId);
});

after(() => {
Expand Down

0 comments on commit 39c7a31

Please sign in to comment.