Closed rodion-arr closed 4 years ago
Looks like show-local-tree
test is unstable. It fails randomly, will try to take a look
@rodion-arr thanks for looking at that failing test :)
@rodion-arr as a note last time I saw a failure like that I thought it was due to a change in aborist. My package.json shows "@npmcli/arborist": "0.0.0-pre.19", which should match what was committed.
I tried doing an npm update and it still passed on my machine, so maybe its flaky as you indicated or something else affects the order that the modules are listed
arborist is up to v0.0.0, fwiw.
Looks like arb.loadActual()
does not guarantee modules ordering. That's why sometimes dep1
is listed after dep2
in show
command result but we are checking for strict order in test. Stability of test depends on loadActual
result:
If we have requirement to save modules order - than this issue is not trivial because of external dependency...
Otherwise we can update show
command tests to have multiple positive cases. E.g for show-local-tree
test:
@pkgjs/support-show-local(0.0.1) - { "versions": [ { "version": "*", "target": { "node": "supported" }, "response": { "type": "best-effort" }, "backing": { "hobby": "https://github.com/pkgjs/support" } } ] }
dep1(0.0.1) - { "versions": [ { "version": "*", "target": { "node": "supported" }, "response": { "type": "best-effort" }, "backing": { "hobby": "https://github.com/pkgjs/support" } } ] }
dep2(0.0.1) - { "versions": [ { "version": "*", "target": { "node": "supported" }, "response": { "type": "best-effort" }, "backing": { "hobby": "https://github.com/pkgjs/support" } } ] }
dep3(0.0.1) - { "versions": [ { "version": "*", "target": { "node": "supported" }, "response": { "type": "best-effort" }, "backing": { "hobby": "https://github.com/pkgjs/support" } } ] }
@pkgjs/support-show-local(0.0.1) - { "versions": [ { "version": "*", "target": { "node": "supported" }, "response": { "type": "best-effort" }, "backing": { "hobby": "https://github.com/pkgjs/support" } } ] }
dep2(0.0.1) - { "versions": [ { "version": "*", "target": { "node": "supported" }, "response": { "type": "best-effort" }, "backing": { "hobby": "https://github.com/pkgjs/support" } } ] }
dep3(0.0.1) - { "versions": [ { "version": "*", "target": { "node": "supported" }, "response": { "type": "best-effort" }, "backing": { "hobby": "https://github.com/pkgjs/support" } } ] }
dep1(0.0.1) - { "versions": [ { "version": "*", "target": { "node": "supported" }, "response": { "type": "best-effort" }, "backing": { "hobby": "https://github.com/pkgjs/support" } } ] }
Just realised that I can simply sort children
Map for module and it fixes the problem.
I'll plan to land this Monday unless there are any objections before then.
@mhdawson Following discussion #9 - I tried to migrate from
got
to other http lib but found another dependency without support for 8.x which we can't replace:npm-registry-fetch
uses optional catch binding and it's failing. So yeah, it looks like we can not go with 8.xThis PR:
arborist
to fresh versionshow
command modules orderingCloses #9