-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrades.deployProxy
hangs in hh coverage
#702
Comments
@davidtperk I'm not familiar with the waffle plugin. Is it using the HardhatEVM? If it's using a ganache instance supplied by waffle solidity-coverage won't work. You might try getting the provider from hardhat and using that as the client: import { waffle, network } from "hardhat";
const { loadFixture } = waffle;
const provider = network.provider; |
It's actually an import { ethers, upgrades } from "hardhat";
import { MyContract } from "../types";
import { waffle } from "hardhat";
const { loadFixture } = waffle;
interface MyFixture {
myContract: MyContract;
}
describe("Tests", () => {
async function myFixture(): Promise<MyFixture> {
const myContractFactory = await ethers.getContractFactory("MyContract", deployer);
console.log(1);
const myContract = (await upgrades.deployProxy(myContractFactory, [0, 0])) as MyContract;
console.log(2); // outputs for `hh test`, not `hh coverage`
return { myContract };
}
it("can test something", async () => {
console.log(0);
const { myContract } = await loadFixture(myFixture);
console.log(3); // outputs for `hh test`, not `hh coverage`
....
});
}); |
hh coverage
upgrades.deployProxy
hangs in hh coverage
@davidtperk Yes but that's probably the first interaction with the client? What network are you running your tests on etc. If you have a link to a public git repo which reproduces this error I can take a look. |
Network is a hardhat fork of kovan. There are two contract reads before |
I think the forking is likely the problem. |
Still need an MRE? |
Would it be possible to isolate whether that triggers the hang on your end - i.e can you write your test so it doesn't rely on a forked network (but use upgrades)? |
I disabled forking and |
@davidtperk Yes, I'm sorry I think an MRE will be necessary to debug this further. |
Haven't been able to reproduce this in a fresh project. |
Fixtures seem to hang indefinitely when running
hh coverage
. All tests that make use of fixtures fail withError: Timeout of 40000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves...
.Conversely, the same tests pass when running
hh test
.The text was updated successfully, but these errors were encountered: