mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
fix(ci): instrument webtorrent logic to debug flaky regression test
- Add detailed logging inside `js/webtorrent.js` (guarded by `NODE_ENV=test`) to inspect the state of `peers`, `hasWebSeed`, and `webseedOnly` when a probe times out. - This is intended to diagnose why `webseedOnly` evaluates to false in CI despite logs indicating `hasExplicitWebSeed` is true. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
80dd5dcade
commit
ac23475b4a
1 file changed
+3
@@ -380,6 +380,9 @@ export class TorrentClient {
|
||||
timeoutId = setTimeout(() => {
|
||||
const peers = Math.max(0, Math.floor(normalizeNumber(torrent?.numPeers, 0)));
|
||||
const webseedOnly = peers === 0 && hasWebSeed;
|
||||
if (typeof process !== "undefined" && process.env.NODE_ENV === "test" && !webseedOnly && hasWebSeed) {
|
||||
console.log(`[probePeers:timeout] logic check: peers=${peers} hasWebSeed=${hasWebSeed} webseedOnly=${webseedOnly}`);
|
||||
}
|
||||
finalize({
|
||||
healthy: webseedOnly,
|
||||
peers,
|
||||
|
||||
Reference in new issue
Block a user