Skip to content

Commit

Permalink
test: fix timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
pcheremu committed Aug 2, 2024
1 parent 4faa3a7 commit e0c1204
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
3 changes: 1 addition & 2 deletions packages/integration-tests/src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ export class Helper {
}

async executeScript(script: string) {
const output = execSync(script, { encoding: "utf-8" });

const output = execSync(script, { encoding: "utf-8", timeout: 10000 });
try {
console.log(`> Run NPM Script "${script}":\n`, output);
return output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default async function (hre: HardhatRuntimeEnvironment) {
const deployer = new Deployer(hre, wallet);
const artifact = await deployer.loadArtifact("L2");
const contract = await deployer.deploy(artifact, []);
await contract.waitForDeployment();
const contractAddress = await contract.getAddress();
console.log(`${artifact.contractName} was deployed to ${contractAddress}`);
await fs.writeFile(Buffer.L2, contractAddress);
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/src/playbook/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { HardhatUserConfig } from "hardhat/config";

const config: HardhatUserConfig = {
zksolc: {
version: "1.4.1",
version: "1.5.2",
compilerSource: "binary",
settings: {},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ export const deployERC20toL1 = async function () {
const bufferFile = playbookRoot + "/" + Buffer.L1;

await helper.executeScript(`cd ${playbookRoot} && npm run compile`);
await helper.delay(1500);
await helper.executeScript(`cd ${playbookRoot} && npm run deployToL1`);

await helper.delay(1500);
const deployedToken = await helper.getStringFromFile(bufferFile);
console.log("The custom ERC20 token has been deployed to L1: ", Logger.textSeparator, deployedToken);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ export const deployERC20toL2 = async function () {
await helper.printLog(bufferFile);

await helper.executeScript(`cd ${playbookRoot} && npm run compile`);
await helper.delay(1500);
await helper.executeScript(`cd ${playbookRoot} && npm run deployToL2`);
await helper.executeScript(`cat ${bufferFile}`);
await helper.delay(1500);
// await helper.executeScript(`cat ${bufferFile}`);
await helper.printLog(`Return to the initial script: deployERC20toL2`);
const deployedToken = await helper.getStringFromFile(bufferFile);
await helper.printLog(`Before the latest PRINT in global`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const depositEth = async function (sum = "0.000009") {

const txHash = deposit.hash;

await deposit.wait(1);
await deposit.waitL1Commit();
await helper.txHashLogger(Logger.deposit, txHash, "ETH");

return txHash;
Expand Down
9 changes: 9 additions & 0 deletions packages/integration-tests/tests/api/qwe.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { localConfig } from "../../src/config";

describe("A stub", () => {
jest.setTimeout(localConfig.standardTimeout);
//@id1513
it("Self test", async () => {
expect(200).toBe(200);
});
});

0 comments on commit e0c1204

Please sign in to comment.