571aecdf42c832e61ee921e977589ca386467d13
max
  Fri Sep 4 12:24:17 2026 -0700
hubCheck: report a bigDataUrl that cannot be opened instead of dropping the track, refs #38260

hubCheckGenome() called trackDbPolishAfterLinkup(), whose pruneEmpties() step hands
each track to addTrackIfDataAccessible(), which frees any track whose data cannot be
reached. That is right for the browser, which should degrade gracefully rather than
draw a broken track, and wrong for hubCheck, whose main job is to say that the file
is unreachable. The track was gone before the file check ran, so hubCheck printed
nothing and exited 0:

cd hubCheck/tests/input
sed 's|test6field.bb|noSuchFile.bb|' fieldCountMismatch.txt > tmp.txt
hubCheck tmp.txt      # only the descriptionUrl warning, missing file not mentioned

Split the non-pruning part of trackDbPolishAfterLinkup() into
trackDbPolishAfterLinkupKeepAll() and call that from hubCheck. Every other caller
still goes through trackDbPolishAfterLinkup() and still prunes, so browser behaviour
is unchanged.

Added a tests/ case whose bigDataUrl does not exist. Before this change it produced
no output and exit 0; now it reports "Couldn't open input/relPath/data/noSuchFile.bb".

Of the existing tests, only badType changes, and it gains a real error that the prune
had been hiding: 'unrecognized type "wig" for track "invalidType"'. badType was
already failing before this commit and still is, for an unrelated reason: seven tests
carry expected output with per-track "missing description page" warnings that no
longer appear, because those hubs point at remote URLs that no longer resolve and
hubCheckTrack aborts at the file check before reaching the description check. That is
stale test data, not addressed here.

diff --git src/hg/utils/hubCheck/tests/makefile src/hg/utils/hubCheck/tests/makefile
index 3b125708415..6e251d6b7a4 100644
--- src/hg/utils/hubCheck/tests/makefile
+++ src/hg/utils/hubCheck/tests/makefile
@@ -1,21 +1,21 @@
 kentSrc = ../../../..
 include ../../../../inc/common.mk
 
 hubCheck = ${DESTBINDIR}/hubCheck
 
-test:: one two errors supertrackChild genomesErrors badType badSubgroups autoScale noLongLabel badGroups goodGroups noCompositeGroup allowWarnings seqNameCheck noSeqNameCheck selfParent dotInName fieldCountMismatch relPath
+test:: one two errors supertrackChild genomesErrors badType badSubgroups autoScale noLongLabel badGroups goodGroups noCompositeGroup allowWarnings seqNameCheck noSeqNameCheck selfParent dotInName fieldCountMismatch relPath missingFile
 
 one:	mkout
 	-${hubCheck} input/hub1.txt > output/output1.txt
 	diff expected/output1.txt output/output1.txt
 
 two:	mkout
 	-${hubCheck} input/hub2.txt > output/output2.txt 2> /dev/null
 	diff expected/output2.txt output/output2.txt
 
 supertrackChild: mkout
 	-${hubCheck} input/supertrackChild.txt > output/supertrackChild.txt 2> /dev/null
 	diff expected/supertrackChild.txt output/supertrackChild.txt
 
 errors:	mkout
 	-${hubCheck} input/manyErrorsHub.txt > output/manyErrors.output.txt 2>/dev/null
@@ -74,20 +74,26 @@
 	diff expected/dotInName.output.txt output/dotInName.output.txt
 
 fieldCountMismatch: mkout
 	-cd input && ${hubCheck} fieldCountMismatch.txt > ../output/fieldCountMismatch.output.txt 2>/dev/null
 	diff expected/fieldCountMismatch.output.txt output/fieldCountMismatch.output.txt
 
 # A hub reached by a relative path, with its data file in a subdirectory below
 # hub.txt. Deliberately NOT run from inside input/, because the point is to check
 # that the hub directory is prepended to bigDataUrl once and not twice. The
 # expected output is a field count mismatch, which hubCheck can only report if it
 # found and opened the file.
 relPath: mkout
 	-${hubCheck} input/relPath/hub.txt > output/relPath.output.txt 2>/dev/null
 	diff expected/relPath.output.txt output/relPath.output.txt
 
+# A bigDataUrl that does not exist has to be reported. hubCheck used to prune such a
+# track out of the list before it ever got checked, and then exited 0 saying nothing.
+missingFile: mkout
+	-${hubCheck} input/relPath/missingFile.txt > output/missingFile.output.txt 2>/dev/null
+	diff expected/missingFile.output.txt output/missingFile.output.txt
+
 mkout::
 	@mkdir -p output
 clean::
 	rm -rf output