-
Notifications
You must be signed in to change notification settings - Fork 93
Fix bad EthPM test #87
Comments
This issue now has a funding of 0.3 ETH (369.6 USD) attached to it.
|
@nlaz Interested in this issue? |
Yeah I'll claim it. Thanks @vs77bb |
Thanks @nlaz! Ideal solution would be to set up proper mocks for EthPM; let me know what approach you're thinking of before diving in. Appreciate it! |
Hey @gnidan thanks for the support. Can you give me an example of an instance where the CI failed because of these tests? This would be helpful to know how to repro the issue. I agree with you that mocking EthPM is the better approach. Disabling tests specifically for CI seems troublesome. After looking at the code, my approach would likely involve giving |
@nlaz it doesn't look like there are currently any failed CI jobs because of that test - your best bet might be to run that test repeatedly (locally). It's an intermittent failure, but I believe it occurs often enough that you should be able to catch it. If you can't catch it, remove the retries logic in the test(s). As far as that approach: it sounds good. I would be interested to see the ramifications outside Thanks! |
@gnidan sadly I am going to back out of this ticket. It's going to take someone more familiar with the codebase than I to avoid accidentally introducing side effects into the code following the above approach. I would recommend either passing in an optional mocked EthPM object into |
thanks for letting us know @nlaz :) |
@gnidan , can you please provide: ReproductionThe steps (ideally command-line commands) to reproduce the error. Additionally, its not clear: does the error occour during the tests of the truffle-core code itself, or when a project is created and tested? Dev System SetupInstructions on how to setup a development environment in order to contribute to truffle (in general, looks like this is generally missing in the overall project). |
Thanks for looking to take this on! To address your points: Dev System Setup: Please see the Truffle project's CONTRIBUTING guide, which should outline the steps you need to get a working local copy of Truffle for development. Reproduce Steps: Although this won't reliably reproduce the issue every time, you can increase the failure rate of the test by removing this line: https://github.com/trufflesuite/truffle-core/blob/develop/test/ethpm.js#L121. The error occurs in Obtaining more reliable reproduce steps can be considered part of the work if it helps you achieve the goal, but it may not be necessary—mocking EthPM in this test would be sufficient to meet the terms of the bounty, since removing the test's dependency on the network would also remove this intermittent failure. Let me know if there's anything else I can help with. Thank you! |
Thanks for all the info. The contributing guide gives good instructions, project setup is quite easy. As for the issue, the expected Time-frame: 7 to 14 days (I will dive-in in tiny daily increments, in parallel to other tasks). For now all fine from my side. |
I've isolated the first problem-root, which is surprisingly the sandbox-creation. The reliance on github repos (not |
TruffleBox.sandbox() works now from local data (on my machine, quick-n-dirty workaround). The related sporadic (or intermittent) errors are gone. I am now at the point where the sporadic test-error related to EthPM happens. Mocking EthPM will not be necessary, just the For today I take a break to overthink all this, possibly to come up with a conceptually clean concept to avoid such errors in future completely. |
GithubExamples.initialize() works now on local data. After fixing/working around #105, #106, #107, #108, #109, the tests run now off-line on my side. Now the 2 surprises: a) Essentially, a EthPM Mock is already available ("Create a fake EthPM host and memory registry"). Further Tasks/Issues
Those tasks/issues would be in essence new 'bounties', as they are quite important. (I will continue at this point with the debugging anyway, but i expect that i will hit on more and more issues) |
Further Isolation: The sporadic error (causing a timeout, even off-line) is caused here: https://github.com/trufflesuite/truffle-core/blob/develop/lib/package.js#L69 and goes further into: https://github.com/trufflesuite/ethpm-js/blob/master/lib/installer.js#L51 I don't think that this should be in any way "mocked away" (thats why I didn't went this path). It should be pinpointed and fixed at all cost, cause such deeply hidden sporadic errors can bring up more trouble, possibly at customer installations. (giving up for today, headaches...) |
@lazaridiscom: This is quite excellent. Thank you very much for all the research on this, it's extremely helpful. I'm out of town this week, but I will review your efforts in more detail when I get back. If you get to a point where you can open a PR with your discovered fixes up to this point, we can get that merged and get you the bounty. It looks like the follow-up work is substantial, so let's plan on getting an additional bounty up for all the effort you've put in. (cc @owocki @vs77bb) |
@gnidan, you're welcome, and I have to thank you for having this opportunity here. I simply continue here, filing new issues that pop up. As for the bounty stuff, I trust you. I'll see to it to get everything into PRs, just please be aware that in some cases its not the the PR that is relevant, but the message "that's the solution" or "there's the bug" (leaving the implementation to the core-developers who know the code/architecture best). This could be relevant for your Gitcoin system, too. |
The IPFS server: problem is not with the IPFS local server, as the relevant URI gives a normal response from a browser (during the timeout period). IPFS host: possibly the ipfs client/host code is responsible (hidden errors like connection-resets etc.) |
FINAL ERRORThe sporadic error is caused by the parallel read-operations within FIXThe solution is simple: ensure that the order of the examples is kept: https://github.com/trufflesuite/ethpm-js/blob/master/lib/indexes/github-examples.js#L55 change: Object.keys(results).forEach(function(package_name) { to examples.forEach(function(package_name) { Thus the original package-name order is kept. RESUMEThe initial happiness is gone, now comes the bitterness of the so so many time spend on this tiny thing. All raised issues should be solved, and of course new test-cases should be implemented, in order to catch this bug within the the EthPM test-suite (for the case of future regression). |
@gnidan , this gitcoin process kills my creativity/productivity. Possibly you can just use this address here for a manual transfer: 0x61cbbb74a5d61a218c9d39ca270b3232de6a9ebd - thank you! Edit: or drop me the necessary fees 0xcAB13E6D9a85296e332dBE0ACDfbB917Ae86f111 (that's my MetaMask account). |
@owocki could we get @lazaridiscom this bounty? @lazaridiscom - sorry that this process has been stressful. I know there is a budget and smart contract functionality for "tipping", but I'll have to sync up with @owocki about how I can do that. definitely want to get you something more than the 0.3 ETH for all the work you've put in. it's been enormously helpful. just please, bear with us as this collaborative effort between Truffle and Gitcoin becomes more fluid. no need to stress about whether you will be paid - you've gone far and above what was expected here, and I will personally make sure you are rewarded accordingly. |
@gnidan , no worries, I trust you folks 100%-ly. I was "ranting" (or "communicating unfiltered") a little bit, simply because I really like this gitcoin thing, and I would like the folks there to feel my ( a new users) pain a little bit, thus they fix things. From you, at this point I would just need the "necessary fees" (the gas, $5 or so) on my MetaMask 0xcAB13E6D9a85296e332dBE0ACDfbB917Ae86f111, so I can continue the usual process on gitcoin (yeah, I fixed this hellish sporadic bug, but I failed to purchase Ether on the exchanges... well...). (You can place new bounties on the issues I've opened. The workarounds need some work to be converted to real patches.) |
@lazaridiscom sent you some ether from my personal account. consider it the equivalent of me buying you lunch :) |
I still don't get all this cryptocoin-stuff. I thought thought that a transfere takes some time (minutes to hours)... but the "lunch" is already available! Thanks a lot! |
Work for 0.3 ETH (261.08 USD) has been submitted by @lazaridiscom. @lazaridiscom, please leave a comment to let the funder (@owocki) (and the other parties involved) that you've submitted you work. If you don't leave a comment, the funder may expire your submission at their discretion.
|
paying out now
@gnidan hit me up on slack and we can work it out |
The funding of 0.3 ETH (259.05 USD) attached to this issue has been approved & issued to @lazaridiscom.
|
@gnidan , this fix is still not applied. I can bet that this causes some other hidded errors somewhere else (caused by ethpm-js): |
The tests for EthPM (https://github.com/trufflesuite/truffle-core/blob/develop/test/ethpm.js) are very finicky, most notably the test around dependencies. This causes CI to fail erroneously all the time.
This can likely be solved via mocks
and/or test flags that disable this test in CI contextsThe text was updated successfully, but these errors were encountered: