Skip to content

Commit

Permalink
Update the tracker to stop printing progress when stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Aug 17, 2023
1 parent d628ce8 commit c41acf9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/cli/test/utils/simulation/SimulationTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export class SimulationTracker {
private nodes: NodePair[];
private clock: EpochClock;
private forkConfig: ChainForkConfig;
private running: boolean = false;

private errors: SimulationAssertionError[] = [];
private stores: Stores;
Expand Down Expand Up @@ -153,6 +154,7 @@ export class SimulationTracker {

async start(): Promise<void> {
debug("starting tracker");
this.running = true;
for (const node of this.nodes) {
this.initEventStreamForNode(node);
}
Expand All @@ -165,11 +167,11 @@ export class SimulationTracker {
}

async stop(): Promise<void> {
// Do nothing;
this.running = false;
}

async clockLoop(slot: number): Promise<void> {
while (!this.signal.aborted) {
while (this.running && !this.signal.aborted) {
// Wait for 2/3 of the slot to consider it missed
await this.clock.waitForStartOfSlot(slot + 2 / 3, slot > 0).catch((e) => {
console.error("error on waitForStartOfSlot", e);
Expand Down

0 comments on commit c41acf9

Please sign in to comment.