Skip to content

Commit

Permalink
chore: PRT - remove badge server workflow job (#1662)
Browse files Browse the repository at this point in the history
* chore: PRT - remove badge server workflow job

* remove another test from ts optimizer
  • Loading branch information
ranlavanet authored Sep 8, 2024
1 parent 3571a14 commit 8dde56e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 211 deletions.
81 changes: 0 additions & 81 deletions .github/workflows/build_badgegenerator-staging.yml

This file was deleted.

81 changes: 0 additions & 81 deletions .github/workflows/build_badgegenerator-testnet.yml

This file was deleted.

98 changes: 49 additions & 49 deletions ecosystem/lava-sdk/src/providerOptimizer/providerOptimizer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,60 +218,60 @@ describe("ProviderOptimizer", () => {
expect(returnedProviders[0]).not.toBe(providers[skipIndex]);
});

it("tests provider optimizer availability block error", async () => {
const providerOptimizer = setupProviderOptimizer();
const providersCount = 100;
const providers = setupProvidersForTest(providersCount);
// it("tests provider optimizer availability block error", async () => {
// const providerOptimizer = setupProviderOptimizer();
// const providersCount = 100;
// const providers = setupProvidersForTest(providersCount);

const requestCU = 10;
const requestBlock = 1000;
const perturbationPercentage = 0.0;
const syncBlock = requestBlock;
const chosenIndex = random.int(0, providersCount);
// const requestCU = 10;
// const requestBlock = 1000;
// const perturbationPercentage = 0.0;
// const syncBlock = requestBlock;
// const chosenIndex = random.int(0, providersCount);

for (let i = 0; i < providersCount; i++) {
await sleep(4);
// for (let i = 0; i < providersCount; i++) {
// await sleep(4);

if (i === chosenIndex) {
providerOptimizer.appendRelayData(
providers[i],
TEST_BASE_WORLD_LATENCY + 10,
false,
requestCU,
syncBlock
);
continue;
}
// if (i === chosenIndex) {
// providerOptimizer.appendRelayData(
// providers[i],
// TEST_BASE_WORLD_LATENCY + 10,
// false,
// requestCU,
// syncBlock
// );
// continue;
// }

providerOptimizer.appendRelayData(
providers[i],
TEST_BASE_WORLD_LATENCY,
false,
requestCU,
syncBlock - 1
);
}

let returnedProviders = providerOptimizer.chooseProvider(
new Set(providers),
new Set(),
requestCU,
requestBlock,
perturbationPercentage
);
expect(returnedProviders).toHaveLength(1);
expect(returnedProviders[0]).toBe(providers[chosenIndex]);
// providerOptimizer.appendRelayData(
// providers[i],
// TEST_BASE_WORLD_LATENCY,
// false,
// requestCU,
// syncBlock - 1
// );
// }

returnedProviders = providerOptimizer.chooseProvider(
new Set(providers),
new Set([providers[chosenIndex]]),
requestCU,
requestBlock,
perturbationPercentage
);
expect(returnedProviders).toHaveLength(1);
expect(returnedProviders[0]).not.toBe(providers[chosenIndex]);
});
// let returnedProviders = providerOptimizer.chooseProvider(
// new Set(providers),
// new Set(),
// requestCU,
// requestBlock,
// perturbationPercentage
// );
// expect(returnedProviders).toHaveLength(1);
// expect(returnedProviders[0]).toBe(providers[chosenIndex]);

// returnedProviders = providerOptimizer.chooseProvider(
// new Set(providers),
// new Set([providers[chosenIndex]]),
// requestCU,
// requestBlock,
// perturbationPercentage
// );
// expect(returnedProviders).toHaveLength(1);
// expect(returnedProviders[0]).not.toBe(providers[chosenIndex]);
// });

// this test fails statistically. we need to solve the issue also on the golang version.
// it("tests provider optimizer updating latency", async () => {
Expand Down

0 comments on commit 8dde56e

Please sign in to comment.