Skip to content

Commit

Permalink
Merge pull request #187 from ThePrez/fix/servertraceoverflow
Browse files Browse the repository at this point in the history
fix: server trace entries overflowing
  • Loading branch information
worksofliam authored Jan 9, 2024
2 parents 8df50db + 451bb43 commit e965fc0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/connection/SCVersion.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

export const SERVER_VERSION_TAG = `v1.4.5`;
export const SERVER_VERSION_FILE = `codeforiserver-1.4.5.jar`;
export const SERVER_VERSION_TAG = `v1.4.6`;
export const SERVER_VERSION_FILE = `codeforiserver-1.4.6.jar`;
20 changes: 20 additions & 0 deletions src/testing/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,5 +418,25 @@ export const JobsSuite: TestSuite = {
console.log(`Old query method took ${oe - os} milliseconds.`);
assert.equal((ne - ns) < (oe - os), true);
}},
{name: `(long-running) Server-side in-memory tracing doesn't overflow`, test: async () => {
assert.strictEqual(ServerComponent.isInstalled(), true);

const instance = getInstance();
const content = instance.getContent();

const newJob = new SQLJob({naming: `sql`});
await newJob.connect();
await newJob.setTraceConfig(ServerTraceDest.IN_MEM, ServerTraceLevel.DATASTREAM);

let numIterations = 1000;
for (let i = 0; i < numIterations; i++) {
let version = await newJob.getVersion();
if(0 == i%20) {
console.log(`long-running test interation ${i}/${numIterations}`);
}
}
let bruh = await newJob.getTraceData();
newJob.close();
}},
]
}

0 comments on commit e965fc0

Please sign in to comment.