Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

fix: increase timeout for name.publish and fix setup code #749

Merged
merged 1 commit into from
Apr 26, 2018

Conversation

alanshaw
Copy link
Contributor

name.publish takes forever! I've increased the timeout to 5 minutes to accommodate.

I also moved the test (which adds a file for future tests) into the before block, I've removed the assertions that this test was making (there should be adequate tests for adding files elsewhere) and instead of hard coding the CID I've extracted it from the return value of the files.add call.

@victorb
Copy link
Contributor

victorb commented Apr 25, 2018

Could we instead of raising the timeout, make sure the daemon is started in offline mode for this test? In offline mode, the publish operation takes about 0.01 seconds, and gives the same output as-if it was online.

@alanshaw
Copy link
Contributor Author

I'm guessing the name.resolve test wouldn't work if we did this?

@victorb
Copy link
Contributor

victorb commented Apr 25, 2018

I'm guessing the name.resolve test wouldn't work if we did this?

It would, as long as we're using the same daemon.

@alanshaw
Copy link
Contributor Author

alanshaw commented Apr 25, 2018

hmm, interesting bug, ipfs.name.publish after ipfs.id in offline mode causes error:

$ ipfs daemon --offline &
[1] 47216
$ Initializing daemon...
Swarm not listening, running in offline mode.
API server listening on /ip4/127.0.0.1/tcp/5001
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8090
Daemon is ready
$ ipfs id
{
	"ID": "QmahispzgXbQ5ewaxSjdrst8KNLzREhVHdhxZwAUHQWqLb",
	"PublicKey": "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDC4Q6B6burDPTlfIkjlF72Q/G72GT7CDBzlZsGI9XKf3XCC5PQiTBcpvKEnUCoBvquiClWE1yJiM4bu1dH/YR5NDBlx9EQzDDmiVvS909cqokRHxA0NY5t83hs8gthoMt6wn15euG2e6LVohqefq6YiiFWgakxDcRyMclLWKiF2t7U6OhMMSd2YdHp15wcHac13ZmdNKhZ/TBhjeKowl4DjAixxLE0kmcK5MsABeQEA+BHukz425K3929onEriSkG7xkSrd0YwKOx6J2Apub7Df8yhcG1PFoTyfTUD/gxkYNrB2jjqUJaNXrK4QDbaDinBNS3KZUn4SQtmxzj2gi4PAgMBAAE=",
	"Addresses": null,
	"AgentVersion": "go-ipfs/0.4.14/5db3846",
	"ProtocolVersion": "ipfs/0.1.0"
}
$ ipfs name publish zdpuArHMUAYi3VtD3f7iSkXxYK9xo687SoNf5stAQNCMzd77k
Error: private key already loaded

I've added an issue here: ipfs/kubo#4978

I'm happy to change to using offline mode but it's not possible right now...we need the node ID so the tests can assert on the publish result.

Copy link
Contributor

@daviddias daviddias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @alanshaw.

@daviddias daviddias merged commit ceb1106 into master Apr 26, 2018
@daviddias daviddias deleted the fix/timeout-for-name-tests branch April 26, 2018 11:00
@ghost ghost removed the in progress label Apr 26, 2018
@victorb
Copy link
Contributor

victorb commented Apr 26, 2018

I'm really not a fan of having us use live IPNS in tests when it's as slow as it is. Can we investigate and see if providing the --local flag can work instead of --offline for now?

@daviddias
Copy link
Contributor

Note it is not "live" as in "live network", the tests spin a mini IPFS network of 3 nodes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants