Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix SIG tests #1105

Merged
merged 1 commit into from
Nov 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@
"temp": "~0.8.3",
"through2": "^2.0.3",
"update-notifier": "^2.3.0",
"yargs": "^10.0.3"
"yargs": "^10.0.3",
"yargs-parser": "^8.0.0"
},
"optionalDependencies": {
"prom-client": "^10.2.2",
Expand Down
15 changes: 6 additions & 9 deletions test/cli/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ describe('daemon', () => {

afterEach(() => clean(repoPath))

// TODO: test fails
it.skip('do not crash if Addresses.Swarm is empty', function (done) {
this.timeout(20 * 1000)
it('do not crash if Addresses.Swarm is empty', function (done) {
this.timeout(100 * 1000)

ipfs('init').then(() => {
return ipfs('config', 'Addresses', JSON.stringify({
Expand All @@ -88,18 +87,16 @@ describe('daemon', () => {
}).catch((err) => done(err))
})

// TODO: test fails
it.skip('should handle SIGINT gracefully', function (done) {
this.timeout(20 * 1000)
it('should handle SIGINT gracefully', function (done) {
this.timeout(100 * 1000)

testSignal(ipfs, 'SIGINT').then(() => {
checkLock(repoPath, done)
}).catch(done)
})

// TODO: test fails
it.skip('should handle SIGTERM gracefully', function (done) {
this.timeout(20 * 1000)
it('should handle SIGTERM gracefully', function (done) {
this.timeout(100 * 1000)
Copy link
Member

Choose a reason for hiding this comment

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

Why does this take so much time?

Copy link
Member Author

Choose a reason for hiding this comment

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

It needs to start and init the repo for the IPFS node each time, which seems to be slow.

Copy link
Member

Choose a reason for hiding this comment

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

The other tests take 40s or less, why 100s in this one?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't able to get it to work with anything below 60 on my box, 100 seems to be the most stable.

I'm guessing that it is because it has to:

  • start the daemon
  • init the repo
  • send the signal and wait for daemon to clean up and exit

The 40 (in i.e. block tests)

this.timeout(40 * 1000)
, are coupled with the 30
this.timeout(30 * 1000)
from the before hook that gets the daemon started and initialized.

So I think it currently is more like 70 + ~30 for graceful shutdown. I think we can tweak the 30 a little bit.

Copy link
Member

Choose a reason for hiding this comment

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

ok


testSignal(ipfs, 'SIGTERM').then(() => {
checkLock(repoPath, done)
Expand Down