| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cfc847d commit 82770cb
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -223,6 +223,7 @@ class ResourceLoader { | |||
| 223 | 223 | return { | |
| 224 | 224 | ok: true, | |
| 225 | 225 | arrayBuffer() { return data.buffer; }, | |
| 226 | + bytes() { return new Uint8Array(data); }, | ||
| 226 | 227 | json() { return JSON.parse(data.toString()); }, | |
| 227 | 228 | text() { return data.toString(); }, | |
| 228 | 229 | }; | |
@@ -721,6 +722,7 @@ class WPTRunner { | |||
| 721 | 722 | // Mark the whole test as failed in wpt.fyi report. | |
| 722 | 723 | reportResult?.finish('ERROR'); | |
| 723 | 724 | this.inProgress.delete(spec); | |
| 725 | + this.report?.write(); | ||
| 724 | 726 | }); | |
| 725 | 727 | ||
| 726 | 728 | await events.once(worker, 'exit').catch(() => {}); | |
@@ -787,6 +789,9 @@ class WPTRunner { | |||
| 787 | 789 | } | |
| 788 | 790 | } | |
| 789 | 791 | ||
| 792 | + // Write the report on clean exit. The report is also written | ||
| 793 | + // incrementally after each spec completes (see completionCallback) | ||
| 794 | + // so that results survive if the process is killed. | ||
| 790 | 795 | this.report?.write(); | |
| 791 | 796 | ||
| 792 | 797 | const ran = queue.length; | |
@@ -873,6 +878,9 @@ class WPTRunner { | |||
| 873 | 878 | reportResult?.finish(); | |
| 874 | 879 | } | |
| 875 | 880 | this.inProgress.delete(spec); | |
| 881 | + // Write report incrementally so results survive even if the process | ||
| 882 | + // is killed before the exit handler runs. | ||
| 883 | + this.report?.write(); | ||
| 876 | 884 | // Always force termination of the worker. Some tests allocate resources | |
| 877 | 885 | // that would otherwise keep it alive. | |
| 878 | 886 | this.workers.get(spec).terminate(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments