Skip to content

Commit 5d3881f

Browse files
committed
Revert "Temporarily turn on device sync and multiple client instances"
This reverts commit 76fcd9b.
1 parent 3d501d6 commit 5d3881f

File tree

4 files changed

+66
-79
lines changed

4 files changed

+66
-79
lines changed

forks/config.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ export const workerNames = [
1212
"random3",
1313
"random4",
1414
"random5",
15-
"random1",
16-
"random2",
17-
"random3",
18-
"random4",
19-
"random5",
2015
] as string[];
2116

2217
// Operations configuration - enable/disable specific operations

helpers/versions.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,6 @@ export const regressionClient = async (
249249
loggingLevel,
250250
apiUrl,
251251
appVersion: APP_VERSION,
252-
historySyncUrl: "http://localhost:5558",
253-
disableDeviceSync: false,
254252
codecs: [new ReactionCodec(), new ReplyCodec()],
255253
});
256254
} catch (error) {

multinode/docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,16 @@ services:
113113
- mlsdb
114114
- validation
115115

116-
validation:
117-
image: ghcr.io/xmtp/mls-validation-service:main
118-
platform: linux/amd64
119-
120116
history-server:
121117
image: ghcr.io/xmtp/message-history-server:main
122118
platform: linux/amd64
123119
ports:
124120
- 5558:5558
125121

122+
validation:
123+
image: ghcr.io/xmtp/mls-validation-service:main
124+
platform: linux/amd64
125+
126126
db:
127127
image: postgres:13
128128
environment:

workers/manager.ts

Lines changed: 62 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ export async function getWorkers(
516516
(v) => v.nodeBindings,
517517
);
518518
}
519-
let successfulResults: Worker[] = [];
519+
let workerPromises: Promise<Worker>[] = [];
520520
let descriptors: string[] = [];
521521

522522
// Handle different input types
@@ -528,75 +528,68 @@ export async function getWorkers(
528528
: getFixedNames(workers)
529529
: workers;
530530
descriptors = names;
531-
for (const descriptor of descriptors) {
532-
successfulResults.push(
533-
await manager.createWorker(
534-
descriptor,
535-
sdkVersions[Math.floor(Math.random() * sdkVersions.length)],
536-
),
537-
);
538-
}
531+
workerPromises = descriptors.map((descriptor) =>
532+
manager.createWorker(
533+
descriptor,
534+
sdkVersions[Math.floor(Math.random() * sdkVersions.length)],
535+
),
536+
);
539537
} else {
540538
// Record input - apply versioning if requested
541539
let entries = Object.entries(workers);
542540

543541
descriptors = entries.map(([descriptor]) => descriptor);
544-
for (const descriptor of descriptors) {
545-
successfulResults.push(
546-
await manager.createWorker(
547-
descriptor,
548-
sdkVersions[Math.floor(Math.random() * sdkVersions.length)],
549-
),
550-
);
551-
}
542+
workerPromises = entries.map(([descriptor, apiUrl]) =>
543+
manager.createWorker(descriptor, sdkVersions[0], apiUrl),
544+
);
545+
}
546+
547+
// Only use progress bar if there are more than 50 workers
548+
const useProgressBar = workerPromises.length > 50;
549+
let progressBar: ProgressBar | undefined;
550+
551+
if (useProgressBar) {
552+
progressBar = new ProgressBar(
553+
workerPromises.length,
554+
`Initializing ${workerPromises.length} workers...`,
555+
);
556+
// Show initial progress immediately
557+
progressBar.update(0);
552558
}
553559

554-
// // Only use progress bar if there are more than 50 workers
555-
// const useProgressBar = workerPromises.length > 50;
556-
// let progressBar: ProgressBar | undefined;
557-
558-
// if (useProgressBar) {
559-
// progressBar = new ProgressBar(
560-
// workerPromises.length,
561-
// `Initializing ${workerPromises.length} workers...`,
562-
// );
563-
// // Show initial progress immediately
564-
// progressBar.update(0);
565-
// }
566-
567-
// // Track all workers in parallel and update progress as each completes
568-
// let completedCount = 0;
569-
// const results = await Promise.allSettled(
570-
// workerPromises.map(async (workerPromise) => {
571-
// try {
572-
// const worker = await workerPromise;
573-
// completedCount++;
574-
// if (useProgressBar && progressBar) {
575-
// progressBar.update(completedCount);
576-
// }
577-
// return worker;
578-
// } catch (error) {
579-
// completedCount++;
580-
// if (useProgressBar && progressBar) {
581-
// progressBar.update(completedCount);
582-
// }
583-
// throw error;
584-
// }
585-
// }),
586-
// );
587-
588-
// // Check for any failures
589-
// const failedResults = results.filter(
590-
// (result) => result.status === "rejected",
591-
// );
592-
// if (failedResults.length > 0) {
593-
// throw failedResults[0].reason;
594-
// }
595-
596-
// // Extract successful results
597-
// const successfulResults = results.map(
598-
// (result) => (result as PromiseFulfilledResult<Worker>).value,
599-
// );
560+
// Track all workers in parallel and update progress as each completes
561+
let completedCount = 0;
562+
const results = await Promise.allSettled(
563+
workerPromises.map(async (workerPromise) => {
564+
try {
565+
const worker = await workerPromise;
566+
completedCount++;
567+
if (useProgressBar && progressBar) {
568+
progressBar.update(completedCount);
569+
}
570+
return worker;
571+
} catch (error) {
572+
completedCount++;
573+
if (useProgressBar && progressBar) {
574+
progressBar.update(completedCount);
575+
}
576+
throw error;
577+
}
578+
}),
579+
);
580+
581+
// Check for any failures
582+
const failedResults = results.filter(
583+
(result) => result.status === "rejected",
584+
);
585+
if (failedResults.length > 0) {
586+
throw failedResults[0].reason;
587+
}
588+
589+
// Extract successful results
590+
const successfulResults = results.map(
591+
(result) => (result as PromiseFulfilledResult<Worker>).value,
592+
);
600593

601594
// Add all successful workers to the manager
602595
for (const worker of successfulResults) {
@@ -625,11 +618,12 @@ function getNextFolderName(): string {
625618
const dataPath = path.resolve(process.cwd(), ".data");
626619
let folder = "a";
627620
if (fs.existsSync(dataPath)) {
628-
const chars = "abcdefghijklmnopqrstuvwxyz0123456789";
629-
folder = Array.from(
630-
{ length: 32 },
631-
() => chars[Math.floor(Math.random() * chars.length)],
632-
).join("");
621+
const existingFolders = fs
622+
.readdirSync(dataPath)
623+
.filter((f) => /^[a-z]$/.test(f));
624+
folder = String.fromCharCode(
625+
"a".charCodeAt(0) + (existingFolders.length % 26),
626+
);
633627
}
634628
return folder;
635629
}

0 commit comments

Comments
 (0)