diff --git a/.github/docker/linux-ci.Dockerfile b/.github/docker/linux-ci.Dockerfile index 3841e304..6d071732 100644 --- a/.github/docker/linux-ci.Dockerfile +++ b/.github/docker/linux-ci.Dockerfile @@ -17,7 +17,7 @@ RUN apt-get update \ ca-certificates curl git sudo tar xz-utils build-essential \ ninja-build pkg-config python3 \ gcc-16 g++-16 libwebkitgtk-6.0-dev lcov libjson-xs-perl \ - xvfb xauth \ + xvfb xauth time \ && rm -rf /var/lib/apt/lists/* # The workspace is mounted from the host runner and owned by another user: let git (and the tests that call it) read it. diff --git a/.github/workflows/BuildAndTest.yml b/.github/workflows/BuildAndTest.yml index 8cb6e1a0..217e0d08 100644 --- a/.github/workflows/BuildAndTest.yml +++ b/.github/workflows/BuildAndTest.yml @@ -63,15 +63,14 @@ jobs: permissions: contents: read packages: read - # Manual runs add extended checks; stability checks opt into desktops. The image job gates only the Linux leg: when it - # fails, Windows and macOS still run (a skipped `needs` would skip the whole matrix) and the Linux leg fails at its pull. + # Only Linux waits for its image. Native desktops below start immediately and reuse these steps. if: ${{ !cancelled() && (github.event_name != 'workflow_dispatch' || inputs.repeat_desktop_tests) }} # No `name:` expression: a skipped matrix job would display it unevaluated. timeout-minutes: 25 strategy: fail-fast: false matrix: - platform: [linux-gcc-webkitgtk, windows-msvc-webview2, macos-clang-wkwebview] + platform: [linux-gcc-webkitgtk] include: - platform: linux-gcc-webkitgtk os: ubuntu-26.04 @@ -79,20 +78,10 @@ jobs: build_type: Debug test_env: {WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS: '1'} options: -DWEBFRONT_EMBED_WEBKITGTK=ON -DWEBFRONT_WEBTEST_FRONTEND=WebKitGTK -DENABLE_COVERAGE=ON - - platform: windows-msvc-webview2 - os: windows-2025 - build_type: Release - test_env: {} - options: -DWEBFRONT_EMBED_WEBVIEW2=ON -DWEBFRONT_WEBTEST_FRONTEND=WebView2 - - platform: macos-clang-wkwebview - os: macos-26 - build_type: Release - test_env: {} - options: -DWEBFRONT_EMBED_WKWEBVIEW=ON -DWEBFRONT_WEBTEST_FRONTEND=WKWebView runs-on: ${{ matrix.os }} # Only the Linux job runs in the prebuilt toolchain image; an empty value means no container. container: ${{ matrix.use_image && fromJSON(format('{{"image":"{0}","credentials":{{"username":"{1}","password":"{2}"}},"options":"--shm-size=1g"}}', needs.linux-image.outputs.image, github.actor, github.token)) || '' }} - steps: + steps: &desktop-steps - uses: actions/checkout@v7 # No step of a build or of its tests needs a JavaScript runtime or package manager: the runner has none from here on. - uses: ./.github/actions/remove-node @@ -109,6 +98,12 @@ jobs: path: .cache/CPM key: cpm-${{ runner.os }}-${{ hashFiles('CMakeLists.txt', 'cmake/*.cmake', 'test/unit/CMakeLists.txt') }} restore-keys: cpm-${{ runner.os }}- + - uses: actions/cache@v4 + with: + path: | + build/bootstrap + build/registry-archives + key: inputs-desktop-${{ runner.os }}-${{ hashFiles('cmake/WebFrontBootstrap.cmake', 'test/web/registry-packages.json') }} - name: Initialize MSVC environment if: runner.os == 'Windows' uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1 @@ -132,7 +127,7 @@ jobs: -DCMAKE_CXX_SCAN_FOR_MODULES=OFF ${{ matrix.options }} - name: Build - run: cmake --build build --config ${{ matrix.build_type }} --parallel 2 + run: python3 test/tools/MeasureCommand.py --output build/build-resources.json -- cmake --build build --config ${{ matrix.build_type }} --parallel 2 - name: Ensure WebView2 Evergreen runtime if: runner.os == 'Windows' shell: pwsh @@ -160,21 +155,69 @@ jobs: if (-not $version) { throw "WebView2 runtime version is missing: $($executable.FullName)" } Write-Host "WebView2 runtime $version at $($executable.FullName)" } + # The fast tier (docs/TEST_TIERS.md): unit tests only, so a plain regression is reported before the browser suite starts. + - name: Fast tests + shell: bash + run: ctest --test-dir build -C ${{ matrix.build_type }} -L fast --parallel 4 --output-on-failure --no-tests=error + - name: Capture CTest dependency graph + shell: bash + run: ctest --test-dir build --show-only=json-v1 > build/ctest-graph.json - name: Test C++ and native browser integration # Only Linux trusted fixtures need the sandbox opt-out on hosted runners. env: ${{ matrix.test_env }} run: >- + python3 test/tools/MeasureCommand.py --output build/suite-resources.json -- cmake -DBUILD_DIR=build -DCONFIG=${{ matrix.build_type }} - -DREPEAT=${{ github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests && '3' || '1' }} + -DREPEAT=${{ (github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests)) && '3' || '1' }} + -DLABEL_EXCLUDE=${{ (github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests)) && 'none' || 'portability' }} -P test/cmake/RunTestSuite.cmake + - name: Analyze CTest timings + if: always() + shell: bash + run: python3 test/tools/ProfileTests.py build/ctest-graph.json build/test-results-*.xml --workers 4 --log build/Testing/Temporary/LastTest.log --ninja-log build/.ninja_log --output build/test-profile.txt + - name: Probe compiler cache on the embedded builds + # Diagnostic (#388): do the Life embedded translation units hit the compiler cache once the suite has warmed it? + if: ${{ !cancelled() }} + continue-on-error: true + shell: bash + run: | + { + echo "Before the probe (whole run):" + sccache --show-stats | grep -E '^(Compile requests|Cache hits|Cache misses) ' + for target in life_embedded life_journey; do + sccache --zero-stats > /dev/null + start=$(date +%s) + cmake --build build --config ${{ matrix.build_type }} --target "$target" --clean-first > "build/probe-$target.log" 2>&1 || tail -n 20 "build/probe-$target.log" + echo "$target clean rebuild: $(( $(date +%s) - start )) s" + sccache --show-stats | grep -E '^(Compile requests|Cache hits|Cache misses) ' + done + # The consumer project of AddSubdirectoryConsumer: its single translation unit against the warm cache. + sccache --zero-stats > /dev/null + start=$(date +%s) + cmake --build build/test/unit/consumer-build --config ${{ matrix.build_type }} --clean-first > build/probe-consumer.log 2>&1 || tail -n 20 build/probe-consumer.log + echo "consumer clean rebuild: $(( $(date +%s) - start )) s" + sccache --show-stats | grep -E '^(Compile requests|Cache hits|Cache misses) ' + } 2>&1 | tee build/embedded-cache-probe.txt - name: Collect coverage if: runner.os == 'Linux' + shell: bash working-directory: build + env: + BENCHMARK_COVERAGE: ${{ github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests }} run: | + set -euo pipefail # lcov 2 on Ubuntu 26.04 rejects the benign line/function hit inconsistencies GCC emits for templates. - lcov --ignore-errors inconsistent,inconsistent --gcov-tool gcov-16 --capture --directory . --output-file coverage.info - lcov --ignore-errors inconsistent,inconsistent --remove coverage.info '/usr/*' '*/examples/*' --output-file coverage.info - lcov --list coverage.info + if [[ "$BENCHMARK_COVERAGE" == true ]]; then + /usr/bin/time -v -o coverage-pp-capture.txt lcov --rc lcov_json_module=JSON::PP --ignore-errors inconsistent,inconsistent --gcov-tool gcov-16 --capture --directory . --output-file coverage-pp.info + fi + perl -MJSON::XS -e 'print "Fast JSON backend JSON::XS $JSON::XS::VERSION\n"' + /usr/bin/time -v -o coverage-capture.txt lcov --verbose --rc lcov_json_module=JSON::XS --ignore-errors inconsistent,inconsistent --gcov-tool gcov-16 --capture --directory . --output-file coverage.info 2>&1 | tee coverage-capture.log + grep -F 'Using JSON module JSON::XS' coverage-capture.log + if [[ "$BENCHMARK_COVERAGE" == true ]]; then + python3 ../test/tools/CompareCoverage.py coverage-pp.info coverage.info + fi + /usr/bin/time -v -o coverage-filter.txt lcov --ignore-errors inconsistent,inconsistent --remove coverage.info '/usr/*' '*/examples/*' --output-file coverage.info + /usr/bin/time -v -o coverage-list.txt lcov --list coverage.info - name: Collect macOS browser crash diagnostics if: failure() && runner.os == 'macOS' timeout-minutes: 1 @@ -190,6 +233,10 @@ jobs: if [ -f "$report" ]; then cp "$report" build/diagnostics/; fi done done + - name: Compiler cache statistics + if: always() + shell: bash + run: sccache --show-stats - name: Retain test timings and diagnostics if: always() uses: actions/upload-artifact@v4 @@ -197,12 +244,91 @@ jobs: name: test-log-${{ runner.os }} path: | build/test-results-*.xml - build/Testing/Temporary/LastTest.log + build/ctest-graph.json + build/embedded-cache-probe.txt + build/test/unit/consumer-build/.ninja_log + build/test-profile* + build/*-resources.json + build/coverage-*.txt + build/coverage-capture.log + build/Testing/Temporary/LastTest*.log build/diagnostics/ if-no-files-found: ignore + desktop-native: + if: github.event_name != 'workflow_dispatch' || inputs.repeat_desktop_tests + permissions: + contents: read + timeout-minutes: 25 + strategy: + fail-fast: false + matrix: + platform: [windows-msvc-webview2, macos-clang-wkwebview] + include: + - platform: windows-msvc-webview2 + os: windows-2025 + build_type: Release + test_env: {} + options: -DWEBFRONT_EMBED_WEBVIEW2=ON -DWEBFRONT_WEBTEST_FRONTEND=WebView2 + - platform: macos-clang-wkwebview + os: macos-26 + build_type: Release + test_env: {} + options: -DWEBFRONT_EMBED_WKWEBVIEW=ON -DWEBFRONT_WEBTEST_FRONTEND=WKWebView + runs-on: ${{ matrix.os }} + steps: *desktop-steps + + # Portability tier: the library consumed from another project, across generators and compilers, with a cold compiler cache. + # It runs weekly and on pull requests into master, where it is a required check (docs/TEST_TIERS.md). + portability: + if: github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests) + name: portability (${{ matrix.name }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + continue-on-error: ${{ matrix.experimental || false }} + strategy: + fail-fast: false + matrix: + include: + - {name: linux-gcc-ninja, os: ubuntu-24.04, generator: Ninja} + - {name: linux-clang-makefiles, os: ubuntu-24.04, generator: Unix Makefiles, clang: true} + - {name: windows-msvc-ninja, os: windows-2025, generator: Ninja} + - {name: macos-appleclang-ninja, os: macos-26, generator: Ninja} + # Not yet exercised on a hosted runner: reported, never blocking. + - {name: windows-msvc-visual-studio, os: windows-2025, generator: Visual Studio 18 2026, experimental: true} + steps: + - uses: actions/checkout@v7 + - uses: ./.github/actions/remove-node + - uses: ./.github/actions/setup-cmake + with: + version: '4.4.4' + - uses: actions/cache@v4 + with: + path: .cache/CPM + key: cpm-extended-${{ runner.os }}-${{ hashFiles('CMakeLists.txt', 'cmake/*.cmake') }} + restore-keys: cpm-extended-${{ runner.os }}- + - name: Initialize MSVC environment + if: runner.os == 'Windows' && matrix.generator == 'Ninja' + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1 + - name: Install Clang 23 + if: matrix.clang + run: | + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/llvm-archive-keyring.gpg > /dev/null + echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble-23 main" | sudo tee /etc/apt/sources.list.d/llvm.list + sudo apt-get update + sudo apt-get install -y clang-23 lld-23 + echo "CC=clang-23" >> "$GITHUB_ENV" + echo "CXX=clang++-23" >> "$GITHUB_ENV" + # No compiler cache: a new user compiles everything. + - name: Configure + shell: bash + run: cmake -S . -B build -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=Release -DWEBFRONT_EMBED_CEF=OFF -DENABLE_TESTING=ON -DENABLE_CACHE=OFF -DCMAKE_CXX_SCAN_FOR_MODULES=OFF + - name: Portability tests + shell: bash + run: ctest --test-dir build -C Release -L portability --output-on-failure --no-tests=error + sanitizers: - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.base_ref == 'master') runs-on: ubuntu-24.04 timeout-minutes: 30 strategy: @@ -222,7 +348,16 @@ jobs: path: .cache/CPM key: cpm-extended-${{ runner.os }}-${{ hashFiles('CMakeLists.txt', 'cmake/*.cmake') }} restore-keys: cpm-extended-${{ runner.os }}- + - uses: actions/cache@v4 + with: + path: | + build-sanitizers/bootstrap + build-sanitizers/registry-archives + key: inputs-sanitizers-${{ runner.os }}-${{ hashFiles('cmake/WebFrontBootstrap.cmake', 'test/web/registry-packages.json') }} - uses: ./.github/actions/remove-node + - uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 + - name: Verify compiler cache launcher + run: sccache --version - uses: ./.github/actions/setup-cmake with: version: '4.4.4' @@ -240,6 +375,7 @@ jobs: run: >- cmake -S . -B build-sanitizers -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWEBFRONT_EMBED_CEF=OFF -DWEBFRONT_BUILD_EXAMPLES=OFF -DENABLE_TESTING=ON -DENABLE_CACHE=OFF + -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_SCAN_FOR_MODULES=OFF ${{ matrix.sanitizer == 'thread' && '-DCMAKE_CXX_FLAGS=-stdlib=libc++ -DENABLE_SANITIZER_THREAD=ON' || '-DENABLE_SANITIZER_ADDRESS=ON -DENABLE_SANITIZER_UNDEFINED_BEHAVIOR=ON -DENABLE_FUZZING=ON -DWEBFRONT_GZIP_DIFFERENTIAL=ON' }} - name: Build run: cmake --build build-sanitizers --parallel 2 @@ -253,6 +389,10 @@ jobs: run: | python3 test/fuzz/GenerateGzipCorpus.py build-sanitizers/gzip-corpus build-sanitizers/test/unit/gzip_differential build-sanitizers/gzip-corpus + - name: Compiler cache statistics + if: always() + shell: bash + run: sccache --show-stats - name: Retain test timings and diagnostics if: always() uses: actions/upload-artifact@v4 @@ -266,16 +406,7 @@ jobs: if: matrix.sanitizer == 'address-undefined' shell: bash run: | - set -euo pipefail - mkdir -p build-sanitizers/test/fuzz/artifacts - for decoder in messages http websocket gzip; do - build-sanitizers/test/fuzz/fuzz_$decoder build-sanitizers/test/fuzz/corpus/$decoder \ - -max_total_time=30 -timeout=5 -max_len=65536 -rss_limit_mb=1024 \ - -artifact_prefix=build-sanitizers/test/fuzz/artifacts/$decoder- - done - build-sanitizers/test/fuzz/fuzz_gzip_differential build-sanitizers/test/fuzz/corpus/gzip \ - -max_total_time=30 -timeout=5 -max_len=65536 -rss_limit_mb=1024 \ - -artifact_prefix=build-sanitizers/test/fuzz/artifacts/gzip-differential- + python3 test/fuzz/RunFuzzers.py build-sanitizers/test/fuzz --jobs 2 --seconds 30 - name: Upload fuzz findings if: failure() && matrix.sanitizer == 'address-undefined' uses: actions/upload-artifact@v4 @@ -286,7 +417,7 @@ jobs: web-integration: timeout-minutes: 30 - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.base_ref == 'master') strategy: fail-fast: false matrix: @@ -300,7 +431,16 @@ jobs: path: .cache/CPM key: cpm-extended-${{ runner.os }}-${{ hashFiles('CMakeLists.txt', 'cmake/*.cmake') }} restore-keys: cpm-extended-${{ runner.os }}- + - uses: actions/cache@v4 + with: + path: | + build-cef/bootstrap + build-cef/registry-archives + key: inputs-web-integration-${{ runner.os }}-${{ hashFiles('cmake/WebFrontBootstrap.cmake', 'test/web/registry-packages.json') }} - uses: ./.github/actions/remove-node + - uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 + - name: Verify compiler cache launcher + run: sccache --version - uses: ./.github/actions/setup-cmake with: @@ -318,7 +458,7 @@ jobs: # The registry packages and the pinned bootstrap environment are downloaded and verified here; wf then builds the rest. - name: Configure CEF integration build - run: cmake . -B ${{github.workspace}}/build-cef -DCMAKE_BUILD_TYPE=Release -DWEBFRONT_EMBED_CEF=ON -DWEBFRONT_BUILD_EXAMPLES=OFF -DENABLE_TESTING=ON + run: cmake . -B ${{github.workspace}}/build-cef -DCMAKE_BUILD_TYPE=Release -DWEBFRONT_EMBED_CEF=ON -DWEBFRONT_BUILD_EXAMPLES=OFF -DENABLE_TESTING=ON -DENABLE_CACHE=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_SCAN_FOR_MODULES=OFF - name: Build browser test run: cmake --build ${{github.workspace}}/build-cef --target webtest developer_integration webfront-wf --parallel 2 @@ -339,6 +479,10 @@ jobs: run: | sudo iptables -F OUTPUT sudo ip6tables -F OUTPUT + - name: Compiler cache statistics + if: always() + shell: bash + run: sccache --show-stats - name: Retain test timings and diagnostics if: always() uses: actions/upload-artifact@v4 diff --git a/AGENTS.md b/AGENTS.md index c05ae655..59251a9b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -113,7 +113,9 @@ Exception: a purely C++ change that reuses an existing encoding, introduces no n - Every bug fix needs a failing regression test at the lowest useful level. Bridge changes also need the browser integration test. - Tests must not require user input, a fixed pre-existing browser session, or public network access after dependencies are configured. -Before declaring work complete, run the CEF-off build and CTest suite. Run the CEF/Xvfb test when changing the bridge, browser lifecycle, module serving, Jasmine assets, or CEF frontend. These PRs must also dispatch `BuildAndTest.yml` on the PR head branch before merging (`gh workflow run BuildAndTest.yml --ref `), then wait for both GCC and Clang CEF jobs to pass. Manual dispatch runs the extended CEF/sanitizer checks without repeating the desktop matrix by default. To also run the complete desktop CTest suite three times, resetting its fixtures on each pass, dispatch with `-f repeat_desktop_tests=true`. It is the required per-PR CEF validation for these changes; the weekly run is a backstop, not a substitute. Update README/status documentation when commands, public behavior, or limitations change. The `NewcomerDocsMatchExamples` CTest case fails when the README quick-start commands or snippets drift from the examples, CMake targets, or CI commands, and `AddSubdirectoryConsumer` builds a minimal parent project linking `WebFront::WebFront`. +Tests are organized in three tiers selected by CTest labels (`fast`, standard, `portability`; see `docs/TEST_TIERS.md`). `ctest -L fast` is the quick check while working; a local run before declaring work complete runs everything. CI runs the fast tier first on each desktop job, the standard tier (everything but `portability`) on every pull request, and the advanced tier (three repetitions of the complete desktop suite, the `portability` job, sanitizers, fuzzers and the GCC/Clang CEF test) weekly and on every pull request into `master`, where those checks are required for the merge once marked required in the branch protection rules. A new test with no label belongs to the standard tier; label a test `portability` only if it verifies the library from another project or toolchain. + +Before declaring work complete, run the CEF-off build and CTest suite. Run the CEF/Xvfb test when changing the bridge, browser lifecycle, module serving, Jasmine assets, or CEF frontend. These PRs, when they target `develop`, must also dispatch `BuildAndTest.yml` on the PR head branch before merging (`gh workflow run BuildAndTest.yml --ref `), then wait for both GCC and Clang CEF jobs to pass; a PR into `master` runs this advanced tier on its own. Manual dispatch runs the extended CEF/sanitizer checks without repeating the desktop matrix by default. To also run the complete desktop CTest suite three times, resetting its fixtures on each pass, dispatch with `-f repeat_desktop_tests=true`. It is the required per-PR CEF validation for these changes; the weekly run is a backstop, not a substitute. Update README/status documentation when commands, public behavior, or limitations change. The `NewcomerDocsMatchExamples` CTest case fails when the README quick-start commands or snippets drift from the examples, CMake targets, or CI commands, and `AddSubdirectoryConsumer` builds a minimal parent project linking `WebFront::WebFront`. ## Git and workspace safety diff --git a/README.md b/README.md index b3d58d17..c449c757 100644 --- a/README.md +++ b/README.md @@ -268,8 +268,9 @@ Configuring with tests enabled downloads, and verifies against their SHA-512, th CTest runs up to four tasks at a time; browser ports remain locked and embedded builds run serially. See [test timings and parallelism](docs/TEST_PERFORMANCE.md) for measurements and constraints. +`ctest -L fast` runs the unit tests in about a second; [test tiers](docs/TEST_TIERS.md) describes what CI runs on each pull request, weekly and before a merge into `master`. -CI runs one combined C++ / native-browser job per desktop platform on each code change. The Linux job also collects and prints GCC line coverage (no external upload). Linux Clang, sanitizers, fuzzing and CEF compatibility run weekly and on demand. Manual dispatch with `repeat_desktop_tests=true` also repeats each desktop CTest case three times for stability checks. Workflow concurrency cancels superseded runs; dependency and compiler caches avoid repeated work. Platform badges above identify the configured matrix; the CI badge reports its aggregate status. Execution times depend on cache state and runner availability. +CI runs one combined C++ / native-browser job per desktop platform on each code change. The Linux job also collects and prints GCC line coverage (no external upload). Linux Clang, sanitizers, fuzzing and CEF compatibility run weekly, on demand and on pull requests into `master`. Manual dispatch with `repeat_desktop_tests=true` also repeats each desktop CTest case three times for stability checks. Workflow concurrency cancels superseded runs; dependency and compiler caches avoid repeated work. Platform badges above identify the configured matrix; the CI badge reports its aggregate status. Execution times depend on cache state and runner availability. ## Contracts and limitations diff --git a/cmake/Frontends.cmake b/cmake/Frontends.cmake index 8e77c5d0..3185fd56 100644 --- a/cmake/Frontends.cmake +++ b/cmake/Frontends.cmake @@ -237,7 +237,11 @@ endfunction() # Separate discovery from registration so configure-only tests can supply a deterministic result. function(webfront_find_xvfb out) find_program(XVFB_RUN_EXECUTABLE xvfb-run) - set(${out} "${XVFB_RUN_EXECUTABLE}" PARENT_SCOPE) + if(XVFB_RUN_EXECUTABLE) + set(${out} "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../test/tools/WithDisplay.sh" PARENT_SCOPE) + else() + set(${out} "${XVFB_RUN_EXECUTABLE}" PARENT_SCOPE) + endif() endfunction() function(webfront_set_browser_test_properties name assets_directory timeout) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 19389bc9..22d7861b 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,18 @@ ## Unreleased +- Tests are organized in tiers by CTest label: `fast` (unit tests, about one second), the standard tier and + `portability` (the consumer project). CI runs the fast tier first, excludes `portability` from pull requests into + `develop`, and runs the advanced tier (three suite repetitions, a portability matrix, sanitizers, fuzzers, CEF) weekly + and on pull requests into `master`. `RunTestSuite.cmake` accepts `LABEL_EXCLUDE`. See [TEST_TIERS](TEST_TIERS.md) (#388). + +- Compatible `wf` regression commands share browser sessions, with fresh command realms and individual CTest reports + (#388). The suite runner reuses one Xvfb display on Linux, supports bounded `PARALLEL`, and records detailed phase/spec + timings. Independent driver groups use OS-assigned ports; `WebFrontConfig::port = "0"` and `app.port()` expose this + with TCPStdnet. Native `WebView2Options::visible` / `WKWebViewOptions::visible` default to true and allow quiet tests. + Windows/macOS CI no longer wait for the Linux image, extended jobs use sccache, fuzzers have bounded concurrency, + and lcov verifies its fast JSON backend. See [TEST_PERFORMANCE](TEST_PERFORMANCE.md). + - Accepted stdnet connections enable `TCP_NODELAY`, including after WebSocket upgrade (#379). This removes the Nagle/delayed-ACK interaction that could delay a callback's return after it sent a browser message. A real-socket regression checks the option directly; diff --git a/docs/DEVELOPER_ENVIRONMENT.md b/docs/DEVELOPER_ENVIRONMENT.md index 73191a12..e79422a9 100644 --- a/docs/DEVELOPER_ENVIRONMENT.md +++ b/docs/DEVELOPER_ENVIRONMENT.md @@ -676,3 +676,9 @@ The packaged-script permission rejection is also exercised end to end. The standard CEF-off suite also checks project transactions, path rejection, Life rules and boundaries, MIME types, bootstrap freshness, package resolution, gzip generation, interruption and offline cache reuse. + +## Repository test sessions + +The non-interactive test driver can run compatible commands in a shared browser session with fresh command frames and +individual JSON reports. The production `wf` command API is unchanged. See [TEST_PERFORMANCE](TEST_PERFORMANCE.md) for +`--suite`, isolated CTest filters, complete fixture repetition, quiet windows, profiling and concurrency constraints. diff --git a/docs/PROJECT_STATUS.md b/docs/PROJECT_STATUS.md index e27684e2..c0a2e92f 100644 --- a/docs/PROJECT_STATUS.md +++ b/docs/PROJECT_STATUS.md @@ -24,6 +24,15 @@ WebFront is a minimal header-only C++23 core plus a standalone developer environ The sections below are dated records, newest first where the topic is current; earlier entries keep the names and numbers of their time. +## Test performance (#388, 2026-10-26) + +Compatible driver commands share sessions while keeping individual CTest assertions, fresh realms and project/profile +isolation. Native failure, watchdog and lifecycle tests remain separate processes. The suite runner supports configurable +bounded parallelism and one dedicated Linux Xvfb display. The esbuild helper in developer specs uses its own Worker to +avoid the off-screen WebKit scheduler cost observed in profiling. Native Windows/macOS options can retain real engines +with hidden windows. Ports assigned by the OS are forwarded to navigation and the content policy. +See [TEST_PERFORMANCE](TEST_PERFORMANCE.md) for commands, measurement limits, fixture locks and qualification evidence. + ## Accepted TCP connections (#379, 2026-10-26) The stdnet provider enables `TCP_NODELAY` before handing accepted sockets to HTTP; diff --git a/docs/TEST_PERFORMANCE.md b/docs/TEST_PERFORMANCE.md index 4cb94f55..bd82cb7f 100644 --- a/docs/TEST_PERFORMANCE.md +++ b/docs/TEST_PERFORMANCE.md @@ -1,74 +1,168 @@ -# Test scheduling and CI diagnostics - -The CI uses `ctest --parallel 4`, independently of `cmake --build --parallel 2`. -Desktop, sanitizer and CEF jobs retain JUnit durations and `LastTest.log` even on -failure. Manual dispatch with `repeat_desktop_tests=true` repeats each desktop -suite three times and also runs the extended CEF and sanitizer checks. The CI -uses `test/cmake/RunTestSuite.cmake`: each pass starts a new CTest invocation, -so fixtures reset before their stateful dependents run. Repeating individual -cases with `--repeat` cannot validate the create/init/install/restore journey. -Each pass retains its own `test-results-.xml` report and the first failed -suite stops the runner with a nonzero status. -Numbered reports from earlier invocations are removed before the first pass, -including when a rerun requests fewer passes or fails early. - -The developer integration prints phase markers before compilation, previews, -scripts, type checks, Jasmine runs and terminal checks. Failed macOS desktop -jobs also retain `build/diagnostics/` (WebKit system log and available crash -reports), so a terminated content process can be investigated beyond its final -frontend error. Missing crash reports do not change the test's failure status. -The developer specs print each started spec through the driver's bridge, retaining -the last name if the page stalls. Self-build drivers have a native watchdog that -expires before CTest's timeout, including its forced-close grace period. -The progress callback is optional: running the specs in an ordinary developer -application or losing the diagnostic bridge does not change their results. - -## Resource audit - -| Tests | Scheduling constraint | +# Test performance and browser sessions (#388) + +Run the complete fixture graph, resetting the projects and profiles on every pass: + +```sh +cmake -DBUILD_DIR=build -DCONFIG=Release -DREPEAT=3 -DPARALLEL=4 -P test/cmake/RunTestSuite.cmake +``` + +`PARALLEL` is a positive CTest worker bound (default 4). Start with four test workers and two compiler workers; +raise them only after measuring peak process-family RSS on the actual machine. Nested embedded builds account for two +CTest processors. On Linux this runner owns one dedicated Xvfb display for the entire invocation. Direct `ctest` commands +still get a private display per browser process. Neither mode opens windows on the user's Linux desktop. + +Compatible commands use one browser per session and a new HTTP iframe/realm per command. The project is deliberately +shared within each group, in this order: + +| Session | Individual CTest assertions retained | | --- | --- | -| Catch2 scenarios | Separate processes; mutable globals and current directories are process-local. Filesystem fixtures atomically claim temporary directories; the one relative `test.tmp` is used by one scenario only. Real socket tests use ephemeral ports, including developer bootstrap without a project. | -| Asset checks | Read sources and compare full headers in memory; no shared temporary gzip/header output. | -| JavaScript and attribution regressions | Own temporary directories/repositories. | -| Frontend selection | Its own `frontend-tests` directory; multi-config tests have a separate working directory. Each configure starts with a fresh fixture cache. | -| CEF option scope | Its own `cef-testing-state` directory; each state still configures separately. | -| Consumer | Separate `consumer-build` tree; no browser is opened. | -| Journey | One project directory (`/jp`) chained by CTest fixtures; the browser lock; the nested build is `RUN_SERIAL`. | -| Browser integration and lifecycle | Keep `RESOURCE_LOCK webfront_port_9002`, including the shared CEF profile and generated browser resources. | -| Life embedded build | Keep `FIXTURES_REQUIRED DeveloperGenerated`, then the build/run fixture dependencies. `RUN_SERIAL TRUE` excludes every other test while it runs, protecting running executables from regeneration/relinking. `PROCESSORS 2` records the nested build's two workers. | - -The browser setup must finish generating headers before the Life embedded build -starts. Browser tests remain mutually exclusive. No test runs alongside the nested build. The consumer has a different -build tree; ordinary independent tests can overlap when the embedded build -is not running. - -Linux coverage processes still write GCC's normal `.gcda` files on the runner's -local filesystem, using libgcov's file locking. Do not copy this parallel coverage -command to a filesystem without locking support without isolating and merging -the profiles. Sanitizer test processes retain their existing runtime settings. - -## Reproduction - -After configuring and building dependencies, run offline from the checkout: +| WfDriverSession | install, passing test, failing test, unknown command, script output | +| JourneyStartSession | create, init, install | +| JourneyBuildSession | check, test, build, embed | +| JourneyRestoreSession | missing offline cache, restore, verified offline cache | +| SelfBuildSession | install, build, developer specs, repeat build, permissions refusal | + +The Journey file preparation and cache deletion remain CTest fixtures between sessions. Self-build reproducibility, +refresh, publication and tampering checks retain their own dependencies. The driver writes a JSON result per command; +CTest checks the original exit code, output, structured report and file assertions. Unexpected failures make the session +fail and do not skip subsequent commands. A browser crash, early closure, missing report or watchdog expiry fails the +session. A native regression exercises a mismatch followed by a successful command. No existing scenario is removed. + +Each new realm owns its bridge connection, imports, timers, Workers, listeners and child frames; removing it releases +those resources. Local/session storage and enumerated IndexedDB databases are reset before the next command. The native project Store survives intentionally. Pinned and rebuilt environments retain different +profiles and URLs/ports. The normal suite resets both; never point the two revisions at a shared persistent profile. + +Filter the familiar CTest names with `ctest --test-dir build -R WfDriverTestFails --output-on-failure`. CTest includes the +session fixture and its prerequisite project setup. For a truly isolated process per case, configure +`-DWEBFRONT_TEST_SESSIONS=OFF` and use the same filter. A case that blocks consumes its session's remaining budget and the later cases then report "No result for the suite case": rerun with sessions off to find the cause. Repetition must repeat the complete fixture graph, rather than +`ctest --repeat` on individual stateful commands. + +The driver's session interface also accepts an explicit list and a name substring filter: + +```json +[ + {"name":"list","command":["list"],"expect":"0"}, + {"name":"unknown","command":["nosuchcommand"],"expect":"1"} +] +``` ```sh -ctest --test-dir build --output-on-failure --parallel 1 --output-junit "$PWD/build/serial.xml" -ctest --test-dir build --output-on-failure --parallel 4 --output-junit "$PWD/build/parallel.xml" -cmake -DBUILD_DIR="$PWD/build" -DREPEAT=3 -P test/cmake/RunTestSuite.cmake -ctest --test-dir build-cef -L web-integration --output-on-failure --parallel 4 +build/test/web/webfront-wf --project /absolute/project --suite /absolute/cases.json \ + --report-dir /absolute/results --filter unknown --timeout 120 ``` -Compare both the total real elapsed time printed by CTest and the individual -JUnit `testcase` durations; summing parallel test times overstates wall time. -For browser/build comparisons, record cold and warm compilation separately. -To repeat every case on the three hosted desktop platforms while also running the -extended CEF/sanitizer checks: +`timeout` optionally sets the native per-case limit in seconds (a decimal string, default 100). The driver enforces +both the per-case deadline and `--timeout` for the whole session; CTest groups sum their original case budgets and keep +a 20-second outer grace. `expect` is a decimal status string; commands are argument arrays, never shell text. Case names must be unique and use +letters, digits, `_` or `-`. The argument JSON is bounded to 60000 bytes by the bridge. Only the selected reports are +rewritten; use a dedicated result directory for each invocation. Without `--suite`, the existing one-command interface +and its exit statuses remain available. + +Browser sessions and independent driver cases bind loopback port `0`; `TCPStdnet` atomically binds an OS-assigned port. +`app.port()` and frontend navigation use that actual port, as does the HTTP/WebSocket content policy. Custom network +providers without `acceptor.local_endpoint().port()` retain their previous port forwarding. Each driver workspace, +profile and project has a separate directory. Tests that mutate the same project retain a resource lock and ordered +fixtures. Native lifecycle tests using fixed URLs keep the `webfront_port_9002` lock. CEF driver sessions additionally override Chromium's +root/cache profile; its default beside the executable would otherwise forward a second process into the first browser +singleton even with independent HTTP ports. Nested builds retain that lock +and `webfront_build_tree` to protect shared browser DLLs and build outputs on Windows, while unrelated unit tests can run. + +## Visible windows and retained lifecycle contracts + +Driver, embedded-distribution and compatible lifecycle windows use `visible=false` on WebView2/WKWebView. They still +create a native window, real engine/controller and native event loop. Window visibility is asserted in the native +lifecycle tests. Failed navigation, close, startup failures, watchdogs and cancellation remain real process tests. +The two macOS executable/dylib registration orders remain separate images and processes, with hidden native windows. + +The developer integration keeps its visible interactive terminal and Life preview. The macOS agent-application case +keeps one visible window because its contract asserts visibility and the absence of a Dock icon. The automated direct +transport contract harness retains one native window on each desktop. Linux's real windows are confined to Xvfb. This +budgets **two visible openings on Windows and three on macOS** in the standard configuration; engine-specific manual +benchmarks and diagnostic runs are outside this budget. Restore all diagnostic windows with +`WEBFRONT_TEST_VISIBLE=1`. A hidden WKWebView requires macOS 14+ (public inactive scheduling preference) and a WindowServer session; this is not a headless-engine substitute. + +## Profiling and interpreting the numbers + +```sh +ctest --test-dir build -C Release --show-only=json-v1 > build/ctest-graph.json +python3 test/tools/MeasureCommand.py --output build/suite-resources.json -- \ + cmake -DBUILD_DIR=build -DCONFIG=Release -DREPEAT=3 -DPARALLEL=4 -P test/cmake/RunTestSuite.cmake +python3 test/tools/ProfileTests.py build/ctest-graph.json build/test-results-*.xml \ + --workers 4 --log build/Testing/Temporary/LastTest.log --output build/test-profile.txt +``` + +Python is only needed for optional resource/graph analysis and the CI fuzzer coordinator; it is not a JavaScript runtime +or package manager. Ordinary builds and the suite runner need no Python. The analyzer also accepts `--ninja-log build/.ninja_log` to rank actual translation-unit/link job durations +(inclusive parallel work, not elapsed build time). It produces the slowest cases, +wall-time median/range across passes and a DOT dependency/lock graph. Solid edges include explicit dependencies and +fixture setup/cleanup; dashed edges identify locks. `dependency_path_seconds` is the longest weighted dependency path; +`lower_bound_seconds` additionally considers worker capacity, locked work and globally serial tests. It is a scheduling +lower bound, not an assertion that locks determine one unique observed critical path. JUnit rounds suite wall time to +whole seconds; the command resource report has finer elapsed time. Sum of case durations is never described as wall time. + +The resource sampler records sampled CPU, process count and peak summed RSS of the command's process family on all +three desktop platforms. Short-lived children can be missed, and shared pages count in each process's RSS: these are +sampled bounds, not precise unique-memory or process-creation counts. Pre-existing services such as a separately started +sccache server and its compiler children can fall outside this process family; sccache's own statistics complement the +sampled build report. It preserves the measured command's failure status. + +`DeveloperBrowserIntegration` emits begin/end timestamps for each major phase and every actual command, including +expected failures. `DeveloperSpecs` reports both ends of each spec. The driver reports browser opening/return and shutdown, +and every suite case, so process-exit costs remain distinguishable. `LastTest-.log` keeps the full transcript of each pass; the suite +runner raises the CTest output cap to 2 MiB per case so JUnit retains these details too. The analyzer ranks the emitted +phase/spec durations. WASM compilation/initialization, command preparation, publication, navigation and execution can be +located by the enclosing command and spec; these spans include waits and bridge traffic, not just CPU time. + +The esbuild helper used by pure developer specs now initializes its real WASM compiler in an esbuild Worker, matching +the developer environment. In an off-screen WebKit frame, `worker:false` made a four-rebuild spec take 20.726 s locally; +`worker:true` ran the same assertions in 0.423 s. The test still changes an imported file, checks a syntax error and checks +recovery. Its inputs were already minimal; reducing assertions would not address the timer/scheduling cost. + +## CI, caches, coverage and fuzzers + +Windows and macOS start independently of `linux-image`; only Linux waits for its Dockerfile-hashed image. The image +already supplies GCC/WebKitGTK and the fast JSON module. It also supplies `/usr/bin/time`. Desktop, CEF and sanitizer +jobs explicitly enable and report sccache. Verified bootstrap and registry archives are cached with keys containing their pin/manifest; configure still checks their integrity. Dependency caches retain their existing keys. +reproducibility outputs are rebuilt rather than restored from a cache. + +The coverage step forces `lcov_json_module=JSON::XS`, verifies lcov's own backend diagnostic and separately times capture, +filtering and listing. A manual desktop-repeat run also captures once with JSON::PP and compares every file's line, +function and branch counters against XS before filtering. Public header coverage and the existing exclusions are unchanged. +The module selection is part of [lcov's JSON support](https://github.com/linux-test-project/lcov/blob/v2.3.1/lib/lcovutil.pm). + +The five fuzzers run with two workers by default, each retaining its 1 GiB RSS limit, its own log, artifact prefix and +writable corpus (including a separate gzip differential corpus). All are awaited and any failure fails the step: ```sh -gh workflow run BuildAndTest.yml --ref -f repeat_desktop_tests=true +python3 test/fuzz/RunFuzzers.py build-sanitizers/test/fuzz --jobs 2 --seconds 30 ``` -Use the ordinary PR run (one repetition) for before/after performance comparisons; -the three-repeat run is a stability check and its wall time includes repetitions. -Every remaining test over 20 s should be reviewed against the costs above rather -than disabled or given weaker assertions. +`--jobs` is configurable; budget at least 1 GiB per worker plus the runner and sanitizer overhead. CI retains logs and +reports on failure and uploads CTest profiles, dependency graphs, sampled resources, lcov phase measurements and cache +statistics. Qualification dispatches `BuildAndTest.yml` with `repeat_desktop_tests=true` for three complete desktop +passes plus GCC/Clang CEF and sanitizers. First-pass fixtures/profiles are fresh; later passes reset them too but may +benefit from OS/filesystem and compiler caches. They are not measurements of a physically cold OS page cache. + +## Measurements + +Durable ranked local profiles are under [test-performance](test-performance/). Measurements use wall time and retain +case/spec counts; differences between machines and independent hosted runs are not controlled speedups. The local +baseline is `da0297f` on Linux/GCC 16 Release/WebKitGTK, two build workers and four CTest workers, with a busy shared +workstation. One baseline pass ran 365 cases/97 developer specs in 172.43 s. Its slowest cases were DeveloperSpecs +(29.819 s), AddSubdirectoryConsumer (23.634 s), JourneyEmbeddedBuild (22.845 s), LifeEmbeddedBuild (22.093 s) and +DeveloperBrowserIntegration (20.150 s). The two globally serial builds accounted for 44.938 s. + +The consumer and embedded tests intentionally compile real C++ consumers of the public headers; frontend configure +checks intentionally keep independent CMake scopes. Their compilation cost cannot be removed by reusing a prebuilt +application without losing the contract. Every case remaining over 20 s should be read with its phase transcript and +these compilation constraints. The updated local passes ran 378 cases/97 developer specs in **92.93, 93.52 and 93.41 s** (median **93.41 s**, range +0.59 s), a 45.8% reduction against the single baseline pass. They reset the fixtures each time. The dependency-only +path of the third pass was 69.347 s; no globally serial test remained. Sampled process-family peak summed RSS across +the three passes was 3.88 GiB, with up to 41 concurrent processes (including browser helpers) and 1179 sampled process +IDs overall; see the sampling caveats above. The consumer and both embedded compilations remain around 22–24 s; +the real developer integration remains around 26 s, including three TypeScript versions and terminal/native cancellation. +Its longest phase is the real Life preview/bridge checks (roughly 8–9 s), followed by the TypeScript 6 install/check +phase (roughly 4 s). Full before/after hosted desktop results and links follow qualification. + +GCC parallel coverage still relies on libgcov's filesystem locking; filesystems without locking require isolated +profiles and merging. macOS failures retain the existing WebKit system/crash diagnostics as well as the phase logs. diff --git a/docs/TEST_TIERS.md b/docs/TEST_TIERS.md new file mode 100644 index 00000000..b2cc4287 --- /dev/null +++ b/docs/TEST_TIERS.md @@ -0,0 +1,44 @@ +# Test tiers (#388) + +The suite has three tiers, selected by CTest labels. A test carries at most one of them; a new test with no label belongs +to the standard tier. + +| Tier | Label | Content | When it runs | +| --- | --- | --- | --- | +| Fast | `fast` | Catch2 unit tests and the Python tool tests; no browser, no nested build | Locally on demand, and as the first test step of every Linux/Windows/macOS desktop job | +| Standard | none, or `web-integration` | Everything but the portability tests: unit tests, real-browser integration, `wf` sessions, embedded builds | Every pull request and every push to `develop` or `master` | +| Portability | `portability` | The library consumed from another project: `AddSubdirectoryConsumer` | Weekly, and on every pull request into `master` | + +```sh +ctest --test-dir build -L fast --parallel 4 # about one second +ctest --test-dir build -LE portability --parallel 4 # the standard tier +ctest --test-dir build -L portability # the portability tier +cmake -DBUILD_DIR=build -DLABEL_EXCLUDE=portability -P test/cmake/RunTestSuite.cmake +``` + +`RunTestSuite.cmake` runs every test unless `LABEL_EXCLUDE` names a label; the CI standard tier passes +`portability`. A local run before a change is declared complete (see `AGENTS.md`) runs everything. + +## Advanced checks + +These run on the weekly schedule (Monday 04:23 UTC), on every pull request whose base is `master`, and on a manual +dispatch with `repeat_desktop_tests`: + +- the complete desktop suite on the three desktop platforms, repeated three times with its fixtures reset on each pass, + including the portability tests; +- the `portability` job: the consumer project configured with Ninja (GCC on Linux, MSVC on Windows, Apple clang on macOS), + with Unix Makefiles (Clang 23) and, reported but never blocking until it has run on a hosted runner, the Visual Studio + 2026 generator. There is no compiler cache: a new user compiles everything; +- the address/undefined and thread sanitizers, the five fuzzers, and the GCC and Clang CEF browser integration. + +The portability matrix does not vary the CMake version: `setup-cmake` pins the SHA-256 of each archive it installs, so +another version needs its checksum added first. + +## Required checks for `master` + +A pull request into `master` must pass all of: the desktop jobs, `portability` (except the experimental Visual Studio +leg), `sanitizers` and `web-integration`. GitHub only enforces this once the checks are marked required in the branch +protection rules of `master`; the workflow cannot set that itself. + +The fast tier does not replace the others: the unit tests are also part of the standard run, so a pull request still +reports one complete result. diff --git a/docs/WEBVIEW2.md b/docs/WEBVIEW2.md index 7dcf79f7..f771aa6d 100644 --- a/docs/WEBVIEW2.md +++ b/docs/WEBVIEW2.md @@ -53,3 +53,11 @@ The page is a UTF-8 URI reference. `show("index.html?x=1#result")` retains its q A literal `+` in the path is automatically encoded as `%2B`: `show("a+b.html")` serves the filename `a+b.html`. This avoids the server decoder's conversion of an unescaped `+` to a space. Plus signs in the query and fragment retain their original meaning. The shared `path-encoding` lifecycle case opens `encoded path %23.html` under every frontend and checks the query and fragment (reaching the page proves the decoded filename); the Jasmine suite, which runs in a frame of the developer environment, serves `a+b.html` through the C++ URL builder. Catch2 also checks this path at the system-browser launcher boundary and verifies shell quoting. On Windows the system browser is opened directly with `ShellExecute`, without a command shell; POSIX launches quote the URL as one argument. + +## Quiet automated sessions + +The per-opening options include `visible` (default `true`). Setting it to `false` creates the real native window and +engine without presenting or focusing the window. This retains the native event loop and startup/navigation deadlines; +it does not provide a sandbox or a headless engine. On macOS a WindowServer session is still required. The test driver +uses this option and supports `WEBFRONT_TEST_VISIBLE=1` for interactive diagnostics. +See [TEST_PERFORMANCE](TEST_PERFORMANCE.md) for the visible-window budget and retained lifecycle cases. diff --git a/docs/WKWEBVIEW.md b/docs/WKWEBVIEW.md index b903b357..28cd63a8 100644 --- a/docs/WKWEBVIEW.md +++ b/docs/WKWEBVIEW.md @@ -189,3 +189,14 @@ These channels exist only in the manual benchmark and the contracts-only test ex Timed measurements are excluded from CTest and CI. [ADR-017](adr/ADR-017-acces-direct-aux-frontends.md) records their measurements and the consequences of Apple's public APIs for a future direct transport, including the Foundation type boundary, handler lifetime, origins and custom resource schemes. iOS remains unverified. + +## Quiet automated sessions + +The per-opening options include `visible` (default `true`). Setting it to `false` creates the real native window and +engine without presenting or focusing the window. This retains the native event loop and startup/navigation deadlines; +it does not provide a sandbox or a headless engine. On macOS a WindowServer session is still required. The test driver +uses this option and supports `WEBFRONT_TEST_VISIBLE=1` for interactive diagnostics. +See [TEST_PERFORMANCE](TEST_PERFORMANCE.md) for the visible-window budget and retained lifecycle cases. + +Hidden sessions require macOS 14+ and use the public `WKPreferences::inactiveSchedulingPolicy` value `None` so +asynchronous bridge and Worker work continues after the load event. Visible sessions retain macOS 13.3 support. diff --git a/docs/test-performance/hosted-before.json b/docs/test-performance/hosted-before.json new file mode 100644 index 00000000..d8763ce4 --- /dev/null +++ b/docs/test-performance/hosted-before.json @@ -0,0 +1,453 @@ +{ + "run": "https://github.com/ambroise-leclerc/WebFront/actions/runs/40323020339", + "commit": "da0297ff235642ccbe665a78e42873da9cde9c98", + "platforms": { + "Linux": [ + { + "pass": "test-results-1.xml", + "cases": 363, + "wall_seconds": 258.0, + "failures": 0, + "skipped": 0, + "slowest": [ + [ + 40.9265, + "DeveloperBrowserIntegration" + ], + [ + 33.9142, + "DeveloperSpecs" + ], + [ + 10.7051, + "SelfBuildRefresh" + ], + [ + 10.0903, + "SelfBuildRepeat" + ], + [ + 9.91151, + "SelfBuild" + ], + [ + 9.18613, + "SelfBuildInstall" + ], + [ + 9.07768, + "JourneyRestore" + ], + [ + 8.92801, + "TestRegistry" + ], + [ + 8.69101, + "JourneyInstall" + ], + [ + 6.38133, + "SelfBuildOutsidePermissions" + ] + ] + }, + { + "pass": "test-results-2.xml", + "cases": 363, + "wall_seconds": 258.0, + "failures": 0, + "skipped": 0, + "slowest": [ + [ + 40.986, + "DeveloperBrowserIntegration" + ], + [ + 33.4403, + "DeveloperSpecs" + ], + [ + 11.2952, + "SelfBuildRefresh" + ], + [ + 9.86543, + "SelfBuild" + ], + [ + 9.71778, + "SelfBuildRepeat" + ], + [ + 9.02905, + "JourneyRestore" + ], + [ + 9.00453, + "SelfBuildInstall" + ], + [ + 8.84903, + "JourneyInstall" + ], + [ + 8.62314, + "TestRegistry" + ], + [ + 6.21907, + "SelfBuildOutsidePermissions" + ] + ] + }, + { + "pass": "test-results-3.xml", + "cases": 363, + "wall_seconds": 263.0, + "failures": 0, + "skipped": 0, + "slowest": [ + [ + 43.2024, + "DeveloperBrowserIntegration" + ], + [ + 33.3391, + "DeveloperSpecs" + ], + [ + 11.4886, + "SelfBuildRefresh" + ], + [ + 10.1644, + "SelfBuild" + ], + [ + 9.86523, + "SelfBuildRepeat" + ], + [ + 9.47549, + "SelfBuildInstall" + ], + [ + 9.2556, + "JourneyRestore" + ], + [ + 8.99259, + "JourneyInstall" + ], + [ + 8.97394, + "TestRegistry" + ], + [ + 6.19489, + "SelfBuildOutsidePermissions" + ] + ] + } + ], + "Windows": [ + { + "pass": "test-results-1.xml", + "cases": 374, + "wall_seconds": 172.0, + "failures": 0, + "skipped": 0, + "slowest": [ + [ + 38.607, + "DeveloperBrowserIntegration" + ], + [ + 24.3898, + "CEFTestingState" + ], + [ + 21.2291, + "DoxygenDocumentation" + ], + [ + 18.2691, + "TestSuiteRepetition" + ], + [ + 17.5742, + "NativeAutodetectReconfiguration" + ], + [ + 15.4087, + "TestRegistry" + ], + [ + 14.86, + "AddSubdirectoryConsumer" + ], + [ + 7.98094, + "FrontendSelection" + ], + [ + 6.67376, + "SelfBuildRepeat" + ], + [ + 6.332, + "DeveloperSpecs" + ] + ] + }, + { + "pass": "test-results-2.xml", + "cases": 374, + "wall_seconds": 149.0, + "failures": 0, + "skipped": 0, + "slowest": [ + [ + 35.6287, + "DeveloperBrowserIntegration" + ], + [ + 25.2895, + "CEFTestingState" + ], + [ + 14.6688, + "NativeAutodetectReconfiguration" + ], + [ + 10.5853, + "FrontendSelection" + ], + [ + 7.52408, + "SelfBuild" + ], + [ + 6.30339, + "SelfBuildRefresh" + ], + [ + 6.25312, + "DeveloperSpecs" + ], + [ + 6.14052, + "SelfBuildRepeat" + ], + [ + 4.39041, + "JourneyCheck" + ], + [ + 4.19065, + "AddSubdirectoryConsumer" + ] + ] + }, + { + "pass": "test-results-3.xml", + "cases": 374, + "wall_seconds": 213.0, + "failures": 1, + "skipped": 2, + "slowest": [ + [ + 97.2078, + "DeveloperBrowserIntegration" + ], + [ + 24.4163, + "CEFTestingState" + ], + [ + 14.9119, + "NativeAutodetectReconfiguration" + ], + [ + 8.85361, + "FrontendSelection" + ], + [ + 7.83699, + "SelfBuildRefresh" + ], + [ + 7.80412, + "SelfBuild" + ], + [ + 6.32349, + "DeveloperSpecs" + ], + [ + 6.17663, + "SelfBuildRepeat" + ], + [ + 5.51798, + "AddSubdirectoryConsumer" + ], + [ + 4.56547, + "JourneyCheck" + ] + ] + } + ], + "macOS": [ + { + "pass": "test-results-1.xml", + "cases": 370, + "wall_seconds": 284.0, + "failures": 0, + "skipped": 0, + "slowest": [ + [ + 36.922, + "DeveloperSpecs" + ], + [ + 34.4557, + "DeveloperBrowserIntegration" + ], + [ + 24.4376, + "NoAiAttributionRegression" + ], + [ + 17.0035, + "CEFTestingState" + ], + [ + 15.1264, + "NativeAutodetectReconfiguration" + ], + [ + 12.7435, + "TestRegistry" + ], + [ + 12.6331, + "FrontendSelection" + ], + [ + 11.9082, + "AddSubdirectoryConsumer" + ], + [ + 9.77643, + "SelfBuild" + ], + [ + 8.9384, + "SelfBuildRefresh" + ] + ] + }, + { + "pass": "test-results-2.xml", + "cases": 370, + "wall_seconds": 249.0, + "failures": 0, + "skipped": 0, + "slowest": [ + [ + 35.6514, + "DeveloperSpecs" + ], + [ + 32.6736, + "DeveloperBrowserIntegration" + ], + [ + 23.0932, + "CEFTestingState" + ], + [ + 21.6808, + "NoAiAttributionRegression" + ], + [ + 12.1905, + "FrontendSelection" + ], + [ + 10.0978, + "SelfBuildRepeat" + ], + [ + 9.82233, + "SelfBuild" + ], + [ + 9.03285, + "SelfBuildRefresh" + ], + [ + 7.79544, + "NativeAutodetectReconfiguration" + ], + [ + 7.16958, + "JourneyCheck" + ] + ] + }, + { + "pass": "test-results-3.xml", + "cases": 370, + "wall_seconds": 258.0, + "failures": 0, + "skipped": 0, + "slowest": [ + [ + 33.6438, + "DeveloperSpecs" + ], + [ + 29.5512, + "DeveloperBrowserIntegration" + ], + [ + 21.0649, + "CEFTestingState" + ], + [ + 20.3561, + "NoAiAttributionRegression" + ], + [ + 10.5993, + "SelfBuildRepeat" + ], + [ + 9.30448, + "SelfBuildRefresh" + ], + [ + 9.28179, + "SelfBuild" + ], + [ + 8.91972, + "NativeAutodetectReconfiguration" + ], + [ + 8.71669, + "AddSubdirectoryConsumer" + ], + [ + 7.50145, + "JourneyCheck" + ] + ] + } + ] + } +} diff --git a/docs/test-performance/linux-after-1.txt b/docs/test-performance/linux-after-1.txt new file mode 100644 index 00000000..9d957ae3 --- /dev/null +++ b/docs/test-performance/linux-after-1.txt @@ -0,0 +1,35 @@ +CTest profile + +Cases: 378 +wall_seconds: 92.000 +sum_seconds: 195.886 +dependency_path_seconds: 68.262 +serial_seconds: 0.000 +lower_bound_seconds: 83.064 + +Slowest cases (seconds): + 26.310 DeveloperBrowserIntegration + 24.342 AddSubdirectoryConsumer + 22.809 JourneyEmbeddedBuild + 21.933 LifeEmbeddedBuild + 15.543 SelfBuildSession + 10.215 JourneyBuildSession + 8.243 SelfBuildRefresh + 4.282 WfDriverTimeout + 3.349 CEFTestingState + 3.301 JourneyRestoreSession + 2.894 WfDriverSession + 2.569 NoAiAttributionRegression + 2.529 TestRegistry + 2.447 JourneyStartSession + 2.362 SelfBuildSiteRepeat + 2.112 WfDriverManifestDirectory + 2.035 FrontendSelection + 1.955 WfDriverSuiteFailure + 1.938 SelfBuildSiteRefusesChange + 1.881 WfDriverRenamedEntry + 1.880 JourneyPermissionDenied + 1.877 WebFrontWebKitGTKIntegration + 1.845 JourneyEmbeddedRun + 1.773 LifeEmbeddedIntegration + 1.737 SelfBuildSite diff --git a/docs/test-performance/linux-after-2.txt b/docs/test-performance/linux-after-2.txt new file mode 100644 index 00000000..fdd91332 --- /dev/null +++ b/docs/test-performance/linux-after-2.txt @@ -0,0 +1,35 @@ +CTest profile + +Cases: 378 +wall_seconds: 93.000 +sum_seconds: 196.682 +dependency_path_seconds: 69.216 +serial_seconds: 0.000 +lower_bound_seconds: 83.583 + +Slowest cases (seconds): + 26.683 DeveloperBrowserIntegration + 24.152 AddSubdirectoryConsumer + 22.616 LifeEmbeddedBuild + 22.544 JourneyEmbeddedBuild + 15.483 SelfBuildSession + 10.920 JourneyBuildSession + 8.197 SelfBuildRefresh + 4.320 WfDriverTimeout + 3.442 CEFTestingState + 3.288 JourneyRestoreSession + 2.649 NoAiAttributionRegression + 2.555 JourneyStartSession + 2.519 WfDriverManifestDirectory + 2.501 TestRegistry + 2.489 WfDriverSession + 2.347 SelfBuildSiteRepeat + 2.110 WfDriverSuiteFailure + 2.021 SelfBuildSiteRefusesChange + 1.957 WebFrontWebKitGTKIntegration + 1.905 WfDriverRenamedEntry + 1.820 FrontendSelection + 1.772 SelfBuildSite + 1.761 LifeEmbeddedIntegration + 1.747 JourneyEmbeddedRun + 1.681 JourneyPermissionDenied diff --git a/docs/test-performance/linux-after-3.dot b/docs/test-performance/linux-after-3.dot new file mode 100644 index 00000000..8906edca --- /dev/null +++ b/docs/test-performance/linux-after-3.dot @@ -0,0 +1,578 @@ +digraph ctest { + "WebFrontJsAssetsFresh"; + "FallbackIndexHtmlAssetFresh"; + "FallbackModuleAssetFresh"; + "FaviconAssetFresh"; + "DeveloperIndexHtmlAssetFresh"; + "DeveloperBootstrapAssetFresh"; + "MinimalCoreAssets"; + "MinimalCoreAssetsRejectsUnlisted"; + "EmbeddedAssetGenerator"; + "BundleInputsFresh"; + "BundleInputsRejectsChange"; + "NoNodeDependency"; + "NoNodeDependencyRejectsInjections"; + "CommandNamesAgree"; + "Scenario: The environment learns whether the application chose the npm registry"; + "Scenario: Gzip CPU work coalesces revisions and bounds jobs, bytes and response leases"; + "Scenario: Destruction waits safely after an explicit shutdown reports a pending external task"; + "Scenario: Accept-Encoding accepts any positive duplicate regardless of order"; + "Scenario: decodeParameter rejects malformed and mistyped payloads"; + "Scenario: WebSocket frames encode extended payload lengths big-endian"; + "Scenario: HTTP encoding token comparison folds ASCII letters only"; + "Scenario: WebLink dispatches every WebSocket frame coalesced in one read"; + "Scenario: New gzip consumers retry work skipped or interrupted by a decoder exception"; + "Scenario: Gzip match copies preserve overlapping history across string growth"; + "Scenario: Selecting WebView2 without support fails clearly"; + "Scenario: BasicWF initializes a custom frontend once"; + "Scenario: Empty wire strings are decoded without indexing past the input"; + "Scenario: Developer publication preserves the installed files until commit"; + "Scenario: The default browser opens a quoted, encoded URL"; + "Scenario: HTTP gzip workers preserve failure statuses and remain lazy on pass-through"; + "Scenario: Cancelled correlation IDs cannot be reused before a late reply"; + "Scenario: The system browser session waits only after a successful launch"; + "Scenario: Bitsets use canonical packed Uint8Array bytes at every size boundary"; + "Scenario: Malformed numeric array payloads are rejected"; + "Scenario: Subscriptions are move-only handles"; + "Scenario: Gzip rejects invalid Huffman codes and match distances"; + "Scenario: Failed frontend initialization is retried and success is shared across application types"; + "Scenario: Gzip work rejects saturation without starting a worker and preserves decode failures"; + "Scenario: A second opener of the project waits for a publication in progress instead of abandoning it"; + "Scenario: HTTP server drains and destroys a populated fallback cache"; + "Scenario: Application task cancellation returns to the server context"; + "Scenario: A project whose own directory exceeds the 260 characters of Windows can be opened"; + "Scenario: Printing a long text waits between its pieces"; + "Scenario: Request parsing"; + "Scenario: A stopped WebSocket does not read again"; + "Scenario: Driver WebView2 profiles isolate environments served at identical URLs"; + "Scenario: BasicWF supports default construction"; + "Scenario: Developer filesystem serves only published resources and protects the bridge"; + "Scenario: Life wraps both axes without treating adjacent rows as neighbors"; + "Scenario: Base64 encoding"; + "Scenario: A command streams its output and reports its exit"; + "Scenario: WebSocket Headers decoding"; + "Scenario: Frontend exceptions propagate only after the server loop completes"; + "Scenario: Stopping a running server releases its connections"; + "Scenario: BasicWF delegates window opening to the selected frontend"; + "Scenario: show opens the default page and returns when the window session ends"; + "Scenario: WebKitGTK retains the first session failure"; + "Scenario: A writer resumes after a failed write reported the closure"; + "Scenario: WebSocket decoder preserves split extended headers and the following frame"; + "Scenario: HTTP cache ownership and policy remain local to the application"; + "Scenario: A WebSocket limits the size of the messages it reassembles"; + "Scenario: Gzip coalescing isolates consumer cancellation and different output budgets"; + "Scenario: A WebSocket rejects a frame announcing gigabytes before buffering it"; + "Scenario: Typed browser senders can be awaited in a tracked task"; + "Scenario: A stopped server hands no connection over"; + "Scenario: A handler may own another subscription to the same browsers"; + "Scenario: Handshake message"; + "Scenario: A sender reports a socket expiring independently of its correlation registry"; + "Scenario: A frontend startup failure before window creation completes the server loop"; + "Scenario: A write failing after its WebLink is destroyed does not reach the link or its successor"; + "Scenario: TypeErasedFunctions"; + "Scenario: Embedded gzip assets are served to identity-only HTTP clients"; + "Scenario: Ack message"; + "Scenario: TemporaryTestEnvironment destructor handles remove_all exception"; + "Scenario: Developer writes are bounded and paths stay inside the explicit project"; + "Scenario: The developer bridge refuses WebSocket clients without an Origin"; + "Scenario: The embedded assets of the core are the readable sources they are generated from"; + "Scenario: Gzip CRC32 matches standard and binary reference vectors"; + "Scenario: Each browser has its own commands"; + "Scenario: RequestParser"; + "Scenario: A browser that stops reading bounds the diagnostic frames queued for it"; + "Scenario: Spawn and scope close agree on whether work was accepted"; + "Scenario: WebLink forwards logs to the browser until a write fails"; + "Scenario: Frontend URLs preserve query and fragment syntax consistently"; + "Scenario: NativeDebugFS root path handling"; + "Scenario: WebKitGTK handles missing native navigation diagnostics"; + "Scenario: Gzip Huffman lookup preserves short tails, long codes and empty distance trees"; + "Scenario: Gzip default output budget is four MiB across concatenated members"; + "Scenario: WebFront compiles after CEF's compiler macros"; + "Scenario: The driver deadline closes both connected and late browsers without losing the request"; + "Scenario: cppFunction deduces a callable's signature from itself"; + "Scenario: SHA1 hashing"; + "Scenario: A downloaded starter never replaces a developer's existing project"; + "Scenario: URL encoding"; + "Scenario: A project path beyond the 260 characters of Windows is published and read like any other"; + "Scenario: NativeDebugFS attempts to open a non-existent file"; + "Scenario: HTTP Server forwards the application policy to gzip fallback"; + "Scenario: The HTTP listener is ready before its event loop starts"; + "Scenario: A failed accept does not stop the server from accepting"; + "Scenario: WebSocket frames can own payloads for asynchronous writes"; + "Scenario: A disconnected gzip requester leaves the shared decode usable by another browser"; + "Scenario: WebSocket Sec Key coding"; + "Scenario: Pending HTTP response buffers remain independent and announce connection closure"; + "Scenario: Gzip lookahead retains prefetched bytes through alignment and bulk reads"; + "Scenario: JsFunction"; + "Scenario: HTTP HEAD describes the negotiated representation"; + "Scenario: Function call correlation identifiers"; + "Scenario: WebSocket header completeness follows its encoded length and mask"; + "Scenario: A UI first parameter selects the caller form of cppFunction"; + "Scenario: WebSocket upgrades authorize Origin before returning 101"; + "Scenario: Encoding bridge messages writes nothing to the standard output"; + "Scenario: Scope drain waits for a concurrent spawn to finish starting"; + "Scenario: A copy of a context may outlive its command"; + "Scenario: BasicWF forwards the configured address to address-aware frontends"; + "Scenario: Deduced cppFunction registration accepts common callable kinds"; + "Scenario: An obsolete registration cannot cancel a replacement with the same wire ID"; + "Scenario: NativeDebugFS opens a binary file"; + "Scenario: A launching frontend leaves the server loop running after show returns"; + "Scenario: Uint8 arrays switch encoding at the compact-length boundary"; + "Scenario: Tracked task errors are logged and do not prevent joining"; + "Scenario: HTTP cached GET and HEAD recheck the active application output budget"; + "Scenario: Ephemeral ports are bound atomically and forwarded to the frontend"; + "Scenario: Typed browser senders are lazy and own their arguments"; + "Scenario: A print task may be awaited after its context is gone"; + "Scenario: NativeDebugFS opens an existing text file using a relative path"; + "Scenario: The frontend contract: open() runs on the calling thread and a closing frontend stops the server"; + "Scenario: Frontend selection aliases"; + "Scenario: Gzip bulk reads require alignment and complete input"; + "Scenario: Paths differing only by case never share a staged file"; + "Scenario: Gzip response leases enforce exact capacity accounting after CPU completion"; + "Scenario: Accept-Encoding defaults to the identity fallback"; + "Scenario: Strings beyond the 16-bit wire length are rejected instead of truncated"; + "Scenario: WebSocket decoder"; + "Scenario: WebSocket decoder waits for an entire split payload"; + "Scenario: Gzip rejects reserved distance declarations and trailing padding"; + "Scenario: Applications own spawned coroutines and expose individual cancellation"; + "Scenario: C++ function responders encode values and failures"; + "Scenario: Content policy controls popup delegation"; + "Scenario: Accept-Encoding combines multiple fields before applying wildcard precedence"; + "Scenario: WebSocket frame encoding"; + "Scenario: DefaultFS layers a configured document root over the embedded fallback"; + "Scenario: A subscription may outlive its application"; + "Scenario: An embedded file reads the same bytes whatever the buffer size"; + "Scenario: Validated gzip cache bounds keys and data and evicts the least recently used revision"; + "Scenario: A frontend startup failure stops the server before propagating"; + "Scenario: Browser senders reject inconsistent return envelopes"; + "Scenario: WebSocket stop() is idempotent"; + "Scenario: Typed browser senders report errors without escaping the receive loop"; + "Scenario: The developer application needs an explicit project and a trusted environment"; + "Scenario: The environment learns where the application keeps the manifest"; + "Scenario: Commands register their bridge functions and list the commands"; + "Scenario: Accept-Encoding ignores unknown parameters while preserving q exclusions"; + "Scenario: Wire numbers outside an integer result range are rejected"; + "Scenario: Accepted connections retain TCP_NODELAY through WebSocket upgrade"; + "Scenario: Gzip decoding validates complete bounded members"; + "Scenario: Validated gzip cache never promotes invalid streams or trusts ISIZE alone"; + "Scenario: Gzip fallback budgets preserve legacy buffer policy compatibility"; + "Scenario: Destroying a server which is not running releases its connections"; + "Scenario: A server scope can release the final owner of a WebSocket during cancellation"; + "Scenario: Shutdown drains running commands"; + "Scenario: HTTP rejects unavailable representations"; + "Scenario: WebLink reports a browser's close frame as its disconnection"; + "Scenario: RequestHandler on a HTTP GET"; + "Scenario: Wire integer conversion keeps truncation and handles 64-bit boundaries"; + "Scenario: Gzip decoding fills a preallocated bounded worker buffer without growing it"; + "Scenario: A browser given the identifier of a disconnected one starts afresh"; + "Scenario: HTTP requests keep method parsing state across interleaved receives"; + "Scenario: Validated gzip cache shares GET content and HEAD metadata within the current output budget"; + "Scenario: URI decoding"; + "Scenario: The public version matches the version detected by CMake"; + "Scenario: WebLink rejects incomplete asynchronous results"; + "Scenario: HTTP considers explicit encoding preferences across fields"; + "Scenario: BasicWF provides the application facilities of commands"; + "Scenario: Accept-Encoding rejects malformed qvalues"; + "Scenario: C++ results too long for the wire reject the JavaScript Promise"; + "Scenario: Spawning during shutdown is rejected with a stopped handle"; + "Scenario: BufferOverflow"; + "Scenario: Typed browser calls propagate receiver cancellation"; + "Scenario: Numeric arrays decode into fixed-size destinations"; + "Scenario: A stalled scope reports absent context work without abandoning its join"; + "Scenario: A failed write closes the WebSocket"; + "Scenario: IndexFileSystem provides basic files for browser support"; + "Scenario: Every MIME type has its own name"; + "Scenario: Commands may outlive their registering object"; + "Scenario: WebFront passes per-application content rules to policy-aware frontends"; + "Scenario: HTTP Request"; + "Scenario: A project directory is listed without leaving the project"; + "Scenario: Browser result and cancellation can race"; + "Scenario: WebKitGTK applies navigation policy without toolkit objects"; + "Scenario: The default Life project is created once and then reused"; + "Scenario: WebSocket decoder preserves coalesced frames"; + "Scenario: Gzip completion resumes on the supplied I/O scheduler"; + "Scenario: HTTP gzip fallback respects the configured decoded byte budget"; + "Scenario: WebLink settles correlated asynchronous results"; + "Scenario: HTTP rechecks the output budget after a suspended worker finishes"; + "Scenario: Popup URLs remain literal arguments to desktop launchers"; + "Scenario: Validated gzip cache permits empty streams under a zero output budget"; + "Scenario: Accept-Encoding matches complete case-insensitive tokens with HTTP whitespace"; + "Scenario: Embedded gzip assets are served to gzip-only HTTP clients"; + "Scenario: The frontend contract: a failing open() stops the server whatever its action"; + "Scenario: The staging area is protected however its path is spelled"; + "Scenario: An embedded frontend blocks show until closure and completes the server loop"; + "Scenario: Numeric arrays are encoded and decoded as owning values"; + "Scenario: HTTP Response"; + "Scenario: Correlation exhaustion fails until an outstanding reply releases an ID"; + "Scenario: TemporaryTestEnvironment::getBinaryData returns the correct binary data"; + "Scenario: Bitset decoding rejects wrong types, lengths, padding and truncation"; + "Scenario: Packed bitsets retain owned bytes, tuple counts and the decoder cursor"; + "Scenario: A group of files beyond the 260 characters of Windows is published together"; + "Scenario: HTTP mutable providers cannot reuse stale identity content or HEAD lengths"; + "Scenario: A manifest and its lock are published together or not at all"; + "Scenario: Life generations follow B3/S23 synchronously"; + "Scenario: A gated cold gzip decode leaves HTTP and WebSocket upgrades responsive on the I/O thread"; + "Scenario: Gzip work skips cancelled queued jobs and drains an active decode on stop"; + "Scenario: A C++ callback can receive the browser that called it"; + "Scenario: Command output is split under the bridge string limit on character boundaries"; + "Scenario: WebLink dispatches browser messages and allocates distinct calls"; + "Scenario: Logger"; + "Scenario: NativeDebugFS opens a JSON configuration file"; + "Scenario: Selecting CEFFrontend without CEF support fails clearly"; + "Scenario: HTTP treats stored x-gzip assets as gzip for fallback and pass-through"; + "Scenario: MimeTypes"; + "Scenario: Several handlers subscribe to connected browsers"; + "Scenario: HTTP fallback rejects corrupt and truncated streams"; + "Scenario: RequestHandler serves JavaScript modules"; + "Scenario: A WebSocket reassembles the messages a browser sends in several frames"; + "Scenario: HTTP stop and disconnected clients cannot outlive the owned gzip worker"; + "Scenario: Accept-Encoding respects explicit and wildcard exclusions"; + "Scenario: Content policy compares complete HTTP origins"; + "Scenario: Startup cleanup never leaves the project through a staging link"; + "Scenario: Accept-Encoding treats x-gzip as the gzip alias"; + "Scenario: Asynchronous Request parsing"; + "Scenario: FunctionReturn"; + "Scenario: Driver suites validate names, commands and filters before opening a browser"; + "Scenario: filesystem::Multi can combine multiple FileSystems"; + "Scenario: BasicWF does not require onUIStarted to be set"; + "Scenario: HTTP version digits cannot overflow their integer fields"; + "Scenario: A link wakes a writer once its write queue drains"; + "Scenario: WebFrontConfig has newcomer-friendly defaults"; + "Scenario: FunctionCall"; + "Scenario: A committed publication that cannot be completed does not prevent opening the project"; + "Scenario: Server drain joins its pending connection without draining unrelated work"; + "Scenario: Gzip buffered reads preserve logical byte offsets and exact member boundaries"; + "Scenario: Selecting WKWebView without support fails clearly"; + "Scenario: Every frontend builds the application URL the same way"; + "Scenario: NativeDebugFS opens a file in a subdirectory"; + "Scenario: Transactions abandoned by a disconnected browser never lock the project"; + "Scenario: Short WebSocket headers do not interpret payload bytes as an extended length"; + "Scenario: Registered C++ function handlers own and invoke their callable"; + "Scenario: Unknown HTTP methods have a safe display name"; + "Scenario: Frontend URLs use the configured listening address"; + "Scenario: Printing waits while the browser has not read the output"; + "Scenario: Ctrl+C stops a running command and the next one runs at once"; + "Scenario: Validated gzip cache lifetime is owned and copies do not share application state"; + "Scenario: The developer store refuses malformed requests without changing the project"; + "Scenario: RequestHandler ignores the query string of a request"; + "Scenario: A publication prepared from stale state is refused"; + "Scenario: DefaultFS serves only embedded assets when no document root is configured"; + "Scenario: HTTP decodes gzip when the stored encoding is unavailable"; + "Scenario: A command may take its context by reference"; + "Scenario: HTTP preserves accepted gzip bytes"; + "Scenario: URI parsing"; + "Scenario: Destroying WebFront closes its established WebSockets"; + "Scenario: macOS CEF paths match the deployed framework layout"; + "Scenario: New directories are durable once their parents are synchronized"; + "Scenario: HTTP GET and HEAD reuse validated gzip revisions across paths and aliases"; + "Scenario: Failed gzip responses retain their job slot until the response lease is released"; + "Scenario: HTTP rejects oversized fallback input before enqueue while preserving gzip pass-through"; + "Scenario: NativeDebugFS provides access to local files"; + "Scenario: WebFrontLifeDeveloper starts without arguments"; + "Scenario: NativeDebugFS opens an empty file"; + "Scenario: Paths from the browser stay inside their directory"; + "Scenario: Handlers may change the subscriptions while being notified"; + "Scenario: CEF subprocess exits preserve their status and diagnostic"; + "Scenario: A rejected WebSocket Origin never reaches the server upgrade callback"; + "TestSuiteRepetition"; + "DoxygenDocumentation"; + "ReleaseVersionConsistency"; + "ReleaseVersionRegression"; + "BootstrapProvisioning"; + "NoAiAttributionRegression"; + "FrameBufferNotFormattedWhenDebugDisabled"; + "RepositoryLayout"; + "RepositoryLayoutRejectsVendoredSources"; + "NewcomerDocsMatchExamples"; + "FrontendSelection"; + "NativeAutodetectReconfiguration"; + "FrontendSelectionMultiConfig"; + "CEFTestingState"; + "CEFCopyDestinations"; + "WebView2UnsupportedToolchain"; + "WebView2LoaderArchitecture"; + "WKWebViewConfiguration"; + "AddSubdirectoryConsumer"; + "TransportBenchmarksAreManual"; + "TestPerformanceProfile"; + "FuzzerConcurrency"; + "TestResourceMeasurement"; + "ArchiveReleaseRejectsInvalidManifest"; + "WebProfileReset"; + "WebKitGTKLifecycle-no-bridge"; + "WebKitGTKLifecycle-early-close"; + "WebKitGTKLifecycle-rejected-ready"; + "WebKitGTKLifecycle-navigation-failure"; + "WebKitGTKLifecycle-path-encoding"; + "WebKitGTKLifecycle-content-policy"; + "WebKitGTKLifecycle-navigation-allow-list"; + "WebFrontWebKitGTKIntegration"; + "WebSuiteInstall" -> "WebFrontWebKitGTKIntegration"; + "WebKitGTKAdapter-no-display"; + "WebKitGTKAdapter-worker-thread"; + "WebKitGTKAdapter-native-close"; + "WebKitGTKAdapter-repeated-show"; + "WebKitGTKAdapter-http-error"; + "WebKitGTKAdapter-pre-run-failure"; + "WebKitGTKAdapter-profile-permissions"; + "WebKitGTKTransportContracts"; + "DeveloperBrowserIntegration"; + "WebProfileReset" -> "DeveloperBrowserIntegration"; + "DeveloperFixtures" -> "DeveloperBrowserIntegration"; + "WfDriverProject"; + "WfDriverInstall"; + "WfDriverProject" -> "WfDriverInstall"; + "WfDriverSession" -> "WfDriverInstall"; + "DeveloperFixtures" -> "WfDriverInstall"; + "WfDriverTestPasses"; + "WfDriverProject" -> "WfDriverTestPasses"; + "WfDriverSession" -> "WfDriverTestPasses"; + "WfDriverInstall" -> "WfDriverTestPasses"; + "DeveloperFixtures" -> "WfDriverTestPasses"; + "WfDriverTestFails"; + "WfDriverProject" -> "WfDriverTestFails"; + "WfDriverSession" -> "WfDriverTestFails"; + "WfDriverInstall" -> "WfDriverTestFails"; + "DeveloperFixtures" -> "WfDriverTestFails"; + "WfDriverCreateStarter"; + "WfDriverProject" -> "WfDriverCreateStarter"; + "DeveloperFixtures" -> "WfDriverCreateStarter"; + "WfDriverRenamedEntry"; + "WfDriverProject" -> "WfDriverRenamedEntry"; + "DeveloperFixtures" -> "WfDriverRenamedEntry"; + "WfDriverPinned"; + "WfDriverProject" -> "WfDriverPinned"; + "DeveloperFixtures" -> "WfDriverPinned"; + "WfDriverManifestDirectory"; + "WfDriverProject" -> "WfDriverManifestDirectory"; + "DeveloperFixtures" -> "WfDriverManifestDirectory"; + "WfDriverManifestDirectoryInstall"; + "WfDriverProject" -> "WfDriverManifestDirectoryInstall"; + "WfDriverManifestDirectory" -> "WfDriverManifestDirectoryInstall"; + "DeveloperFixtures" -> "WfDriverManifestDirectoryInstall"; + "WfDriverManifestDirectoryUnsafe"; + "WfDriverProject" -> "WfDriverManifestDirectoryUnsafe"; + "DeveloperFixtures" -> "WfDriverManifestDirectoryUnsafe"; + "WfDriverUnknownCommand"; + "WfDriverProject" -> "WfDriverUnknownCommand"; + "WfDriverSession" -> "WfDriverUnknownCommand"; + "DeveloperFixtures" -> "WfDriverUnknownCommand"; + "WfDriverScriptOutput"; + "WfDriverProject" -> "WfDriverScriptOutput"; + "WfDriverSession" -> "WfDriverScriptOutput"; + "DeveloperFixtures" -> "WfDriverScriptOutput"; + "WfDriverTimeout"; + "WfDriverProject" -> "WfDriverTimeout"; + "DeveloperFixtures" -> "WfDriverTimeout"; + "WfDriverWrongIntegrity"; + "WfDriverProject" -> "WfDriverWrongIntegrity"; + "DeveloperFixtures" -> "WfDriverWrongIntegrity"; + "WfDriverMissingArchive"; + "WfDriverProject" -> "WfDriverMissingArchive"; + "DeveloperFixtures" -> "WfDriverMissingArchive"; + "WfDriverIncompatibleApi"; + "WfDriverProject" -> "WfDriverIncompatibleApi"; + "DeveloperFixtures" -> "WfDriverIncompatibleApi"; + "WfDriverIncompatibleProtocol"; + "WfDriverProject" -> "WfDriverIncompatibleProtocol"; + "DeveloperFixtures" -> "WfDriverIncompatibleProtocol"; + "WfDriverUsage"; + "WfDriverBadTimeout"; + "WfDriverSuiteFailure"; + "WfDriverProject" -> "WfDriverSuiteFailure"; + "DeveloperFixtures" -> "WfDriverSuiteFailure"; + "WfDriverSuiteContinues"; + "WfDriverSuiteFailure" -> "WfDriverSuiteContinues"; + "JourneyCreate"; + "WfDriverProject" -> "JourneyCreate"; + "JourneyStartSession" -> "JourneyCreate"; + "DeveloperFixtures" -> "JourneyCreate"; + "JourneyInit"; + "WfDriverProject" -> "JourneyInit"; + "JourneyCreate" -> "JourneyInit"; + "JourneyStartSession" -> "JourneyInit"; + "DeveloperFixtures" -> "JourneyInit"; + "JourneyInstall"; + "JourneyInit" -> "JourneyInstall"; + "WfDriverProject" -> "JourneyInstall"; + "JourneyStartSession" -> "JourneyInstall"; + "DeveloperFixtures" -> "JourneyInstall"; + "JourneyFiles"; + "JourneyInstall" -> "JourneyFiles"; + "JourneyCheck"; + "JourneyBuildSession" -> "JourneyCheck"; + "JourneyFiles" -> "JourneyCheck"; + "WfDriverProject" -> "JourneyCheck"; + "DeveloperFixtures" -> "JourneyCheck"; + "JourneyTest"; + "JourneyBuildSession" -> "JourneyTest"; + "WfDriverProject" -> "JourneyTest"; + "JourneyCheck" -> "JourneyTest"; + "DeveloperFixtures" -> "JourneyTest"; + "JourneyBuild"; + "JourneyBuildSession" -> "JourneyBuild"; + "WfDriverProject" -> "JourneyBuild"; + "JourneyTest" -> "JourneyBuild"; + "DeveloperFixtures" -> "JourneyBuild"; + "JourneyEmbed"; + "JourneyBuildSession" -> "JourneyEmbed"; + "JourneyBuild" -> "JourneyEmbed"; + "WfDriverProject" -> "JourneyEmbed"; + "DeveloperFixtures" -> "JourneyEmbed"; + "JourneyPermissionDenied"; + "WfDriverProject" -> "JourneyPermissionDenied"; + "JourneyEmbed" -> "JourneyPermissionDenied"; + "DeveloperFixtures" -> "JourneyPermissionDenied"; + "JourneyEmptyCache"; + "JourneyEmbed" -> "JourneyEmptyCache"; + "JourneyOfflineMissing"; + "JourneyEmptyCache" -> "JourneyOfflineMissing"; + "JourneyRestoreSession" -> "JourneyOfflineMissing"; + "WfDriverProject" -> "JourneyOfflineMissing"; + "DeveloperFixtures" -> "JourneyOfflineMissing"; + "JourneyRestore"; + "WfDriverProject" -> "JourneyRestore"; + "JourneyRestoreSession" -> "JourneyRestore"; + "JourneyOfflineMissing" -> "JourneyRestore"; + "DeveloperFixtures" -> "JourneyRestore"; + "JourneyOfflineVerified"; + "JourneyRestore" -> "JourneyOfflineVerified"; + "JourneyRestoreSession" -> "JourneyOfflineVerified"; + "WfDriverProject" -> "JourneyOfflineVerified"; + "DeveloperFixtures" -> "JourneyOfflineVerified"; + "JourneyEmbeddedBuild"; + "JourneyEmbed" -> "JourneyEmbeddedBuild"; + "JourneyEmbeddedRun"; + "JourneyEmbeddedBuild" -> "JourneyEmbeddedRun"; + "WebSuiteProject"; + "WebSuiteInstall"; + "TestRegistry" -> "WebSuiteInstall"; + "WebSuiteProject" -> "WebSuiteInstall"; + "SelfBuildProject"; + "TestRegistry"; + "SelfBuildProject" -> "TestRegistry"; + "SelfBuildInstall"; + "TestRegistry" -> "SelfBuildInstall"; + "SelfBuildProject" -> "SelfBuildInstall"; + "SelfBuildSession" -> "SelfBuildInstall"; + "SelfBuild"; + "SelfBuildSession" -> "SelfBuild"; + "SelfBuildInstall" -> "SelfBuild"; + "DeveloperSpecs"; + "SelfBuildSession" -> "DeveloperSpecs"; + "SelfBuildInstall" -> "DeveloperSpecs"; + "SelfBuildRepeat"; + "SelfBuild" -> "SelfBuildRepeat"; + "SelfBuildSession" -> "SelfBuildRepeat"; + "SelfBuildOutsidePermissions"; + "SelfBuild" -> "SelfBuildOutsidePermissions"; + "SelfBuildSession" -> "SelfBuildOutsidePermissions"; + "SelfBuildReproducible"; + "SelfBuildRepeat" -> "SelfBuildReproducible"; + "DeveloperFixtures"; + "SelfBuild" -> "DeveloperFixtures"; + "SelfBuildRefresh"; + "SelfBuildReproducible" -> "SelfBuildRefresh"; + "SelfBuildRefreshMatchesSources"; + "SelfBuildRefresh" -> "SelfBuildRefreshMatchesSources"; + "SelfBuildSite"; + "SelfBuild" -> "SelfBuildSite"; + "SelfBuildSiteRepeat"; + "SelfBuildSite" -> "SelfBuildSiteRepeat"; + "SelfBuildSiteTamper"; + "SelfBuildSiteRepeat" -> "SelfBuildSiteTamper"; + "SelfBuildSiteRefusesChange"; + "SelfBuildSiteTamper" -> "SelfBuildSiteRefusesChange"; + "JourneySessionProject"; + "WfDriverSession"; + "WfDriverProject" -> "WfDriverSession"; + "DeveloperFixtures" -> "WfDriverSession"; + "JourneyStartSession"; + "JourneySessionProject" -> "JourneyStartSession"; + "DeveloperFixtures" -> "JourneyStartSession"; + "JourneyBuildSession"; + "JourneyFiles" -> "JourneyBuildSession"; + "DeveloperFixtures" -> "JourneyBuildSession"; + "JourneyRestoreSession"; + "JourneyEmptyCache" -> "JourneyRestoreSession"; + "DeveloperFixtures" -> "JourneyRestoreSession"; + "SelfBuildSession"; + "TestRegistry" -> "SelfBuildSession"; + "SelfBuildProject" -> "SelfBuildSession"; + "LifeEmbeddedBuild"; + "DeveloperBrowserIntegration" -> "LifeEmbeddedBuild"; + "LifeEmbeddedIntegration"; + "LifeEmbeddedBuild" -> "LifeEmbeddedIntegration"; + "lock: webfront_port_9002" -> "WebKitGTKLifecycle-no-bridge" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKLifecycle-early-close" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKLifecycle-rejected-ready" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKLifecycle-navigation-failure" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKLifecycle-path-encoding" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKLifecycle-content-policy" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKLifecycle-navigation-allow-list" [style=dashed]; + "lock: webfront_port_9002" -> "WebFrontWebKitGTKIntegration" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKAdapter-no-display" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKAdapter-worker-thread" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKAdapter-native-close" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKAdapter-repeated-show" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKAdapter-http-error" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKAdapter-pre-run-failure" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKAdapter-profile-permissions" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKTransportContracts" [style=dashed]; + "lock: webfront_port_9002" -> "DeveloperBrowserIntegration" [style=dashed]; + "lock: webfront_port_9002" -> "JourneyEmbeddedBuild" [style=dashed]; + "lock: webfront_port_9002" -> "JourneyEmbeddedRun" [style=dashed]; + "lock: webfront_port_9002" -> "LifeEmbeddedBuild" [style=dashed]; + "lock: webfront_port_9002" -> "LifeEmbeddedIntegration" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-project" -> "WfDriverInstall" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-project" -> "WfDriverTestPasses" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-project" -> "WfDriverTestFails" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-project" -> "WfDriverRenamedEntry" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-project" -> "WfDriverManifestDirectoryUnsafe" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-project" -> "WfDriverUnknownCommand" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-project" -> "WfDriverScriptOutput" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-project" -> "WfDriverTimeout" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-project" -> "WfDriverWrongIntegrity" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-project" -> "WfDriverMissingArchive" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-project" -> "WfDriverIncompatibleApi" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-project" -> "WfDriverIncompatibleProtocol" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-project" -> "WfDriverSuiteFailure" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-project" -> "WfDriverSession" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-starter" -> "WfDriverCreateStarter" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-pinned" -> "WfDriverPinned" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-manifest-dir" -> "WfDriverManifestDirectory" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/wf-driver-manifest-dir" -> "WfDriverManifestDirectoryInstall" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/jp" -> "JourneyCreate" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/jp" -> "JourneyInit" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/jp" -> "JourneyInstall" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/jp" -> "JourneyCheck" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/jp" -> "JourneyTest" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/jp" -> "JourneyBuild" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/jp" -> "JourneyEmbed" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/jp" -> "JourneyPermissionDenied" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/jp" -> "JourneyOfflineMissing" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/jp" -> "JourneyRestore" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/jp" -> "JourneyOfflineVerified" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/jp" -> "JourneyStartSession" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/jp" -> "JourneyBuildSession" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/jp" -> "JourneyRestoreSession" [style=dashed]; + "lock: webfront_build_tree" -> "JourneyEmbeddedBuild" [style=dashed]; + "lock: webfront_build_tree" -> "LifeEmbeddedBuild" [style=dashed]; + "lock: /home/leclerc/devel/WebFront/build-388/test/web/web-suite-project" -> "WebSuiteInstall" [style=dashed]; + "lock: self-build-project" -> "SelfBuildProject" [style=dashed]; + "lock: self-build-project" -> "TestRegistry" [style=dashed]; + "lock: self-build-project" -> "SelfBuildInstall" [style=dashed]; + "lock: self-build-project" -> "SelfBuild" [style=dashed]; + "lock: self-build-project" -> "DeveloperSpecs" [style=dashed]; + "lock: self-build-project" -> "SelfBuildRepeat" [style=dashed]; + "lock: self-build-project" -> "SelfBuildOutsidePermissions" [style=dashed]; + "lock: self-build-project" -> "SelfBuildReproducible" [style=dashed]; + "lock: self-build-project" -> "DeveloperFixtures" [style=dashed]; + "lock: self-build-project" -> "SelfBuildRefresh" [style=dashed]; + "lock: self-build-project" -> "SelfBuildRefreshMatchesSources" [style=dashed]; + "lock: self-build-project" -> "SelfBuildSite" [style=dashed]; + "lock: self-build-project" -> "SelfBuildSiteRepeat" [style=dashed]; + "lock: self-build-project" -> "SelfBuildSiteTamper" [style=dashed]; + "lock: self-build-project" -> "SelfBuildSiteRefusesChange" [style=dashed]; + "lock: self-build-project" -> "SelfBuildSession" [style=dashed]; +} diff --git a/docs/test-performance/linux-after-3.txt b/docs/test-performance/linux-after-3.txt new file mode 100644 index 00000000..db3967a7 --- /dev/null +++ b/docs/test-performance/linux-after-3.txt @@ -0,0 +1,35 @@ +CTest profile + +Cases: 378 +wall_seconds: 93.000 +sum_seconds: 196.767 +dependency_path_seconds: 69.347 +serial_seconds: 0.000 +lower_bound_seconds: 83.406 + +Slowest cases (seconds): + 26.658 DeveloperBrowserIntegration + 24.005 AddSubdirectoryConsumer + 22.631 LifeEmbeddedBuild + 22.285 JourneyEmbeddedBuild + 15.439 SelfBuildSession + 10.566 JourneyBuildSession + 8.422 SelfBuildRefresh + 4.268 WfDriverTimeout + 3.672 CEFTestingState + 3.161 JourneyRestoreSession + 2.897 NoAiAttributionRegression + 2.830 WfDriverManifestDirectory + 2.754 TestRegistry + 2.600 WfDriverSession + 2.399 JourneyStartSession + 2.153 SelfBuildSiteRepeat + 2.116 WebFrontWebKitGTKIntegration + 1.934 SelfBuildSiteRefusesChange + 1.932 WfDriverRenamedEntry + 1.896 WfDriverSuiteFailure + 1.881 FrontendSelection + 1.846 SelfBuildSite + 1.763 JourneyEmbeddedRun + 1.732 LifeEmbeddedIntegration + 1.712 JourneyPermissionDenied diff --git a/docs/test-performance/linux-after-phases.txt b/docs/test-performance/linux-after-phases.txt new file mode 100644 index 00000000..30711386 --- /dev/null +++ b/docs/test-performance/linux-after-phases.txt @@ -0,0 +1,609 @@ + 8789.000 ms 11964.000ms end Life preview and bridge + 8695.000 ms 11838.000ms end Life preview and bridge + 7855.000 ms 11341.000ms end Life preview and bridge + 4237.000 ms 21309.000ms end install TypeScript 6.0.3 + 4228.000 ms 21176.000ms end install TypeScript 6.0.3 + 3997.000 ms 25165.000ms end Jasmine runs + 3969.000 ms 25278.000ms end Jasmine runs + 3846.000 ms 21168.000ms end install TypeScript 6.0.3 + 3725.000 ms 15066.000ms end scripts and cancellation + 3716.000 ms 24892.000ms end Jasmine runs + 3538.000 ms 15502.000ms end scripts and cancellation + 3410.000 ms 15248.000ms end scripts and cancellation + 3119.000 ms 10983.000ms end command embed ui/main.tsx --output + 2732.000 ms 10720.000ms end command embed ui/main.tsx --output + 2467.000 ms 3486.000ms end build and incremental preview + 2323.000 ms 10647.000ms end command embed ui/main.tsx --output + 2145.000 ms 3175.000ms end build and incremental preview + 2143.000 ms 3143.000ms end build and incremental preview + 1830.000 ms 16948.000ms end install TypeScript 5.9.3 and declarations + 1811.000 ms 7987.000ms end command embed LifeUI + 1776.000 ms 17072.000ms end install TypeScript 5.9.3 and declarations + 1752.000 ms 17322.000ms end install TypeScript 5.9.3 and declarations + 1603.000 ms 7863.000ms end command embed LifeUI + 1409.000 ms 8321.000ms end command embed LifeUI + 1362.000 ms 4848.000ms end command preview + 1262.000 ms 2042.000ms end wf run and wf exec a stop after the commit was sent lets the publication complete with the whole new content status=passed + 1209.000 ms 16948.000ms end command check + 1149.000 ms 4324.000ms end command preview + 1146.000 ms 4289.000ms end command preview + 1087.000 ms 17071.000ms end command check + 1077.000 ms 17321.000ms end command check + 1071.000 ms 1868.000ms end wf run and wf exec a stop after the commit was sent lets the publication complete with the whole new content status=passed + 1048.000 ms 1796.000ms end wf run and wf exec a stop after the commit was sent lets the publication complete with the whole new content status=passed + 1030.000 ms 18730.000ms end command check + 1023.000 ms 18781.000ms end command check + 952.000 ms 1983.000ms end command build + 901.000 ms 18862.000ms end command check + 864.000 ms 20846.000ms end command check + 860.000 ms 1879.000ms end command build + 856.000 ms 26021.000ms end terminal and sessions + 842.000 ms 19580.000ms end command check + 835.000 ms 25727.000ms end terminal and sessions + 823.000 ms 19606.000ms end command check + 819.000 ms 1820.000ms end command build + 808.000 ms 20776.000ms end command check + 801.000 ms 26079.000ms end terminal and sessions + 793.000 ms 19657.000ms end command check + 751.000 ms 17700.000ms end command install typescript@6.0.3 + 728.000 ms 2627.000ms end command dev watch/main.ts + 711.000 ms 20770.000ms end command check + 687.000 ms 15983.000ms end command install typescript@5.9.3 webfront-fixture-typed + 685.000 ms 17757.000ms end command install typescript@6.0.3 + 674.000 ms 16244.000ms end command install typescript@5.9.3 webfront-fixture-typed + 669.000 ms 3545.000ms end wf test a result is cut to fit a bridge string, keeping the counts and the status status=passed + 658.000 ms 11747.000ms end command preview restore/main.js + 655.000 ms 3311.000ms end wf test a result is cut to fit a bridge string, keeping the counts and the status status=passed + 638.000 ms 17961.000ms end command install typescript@6.0.3 + 619.000 ms 15738.000ms end command install typescript@5.9.3 webfront-fixture-typed + 616.000 ms 11875.000ms end command preview restore/main.js + 614.000 ms 3297.000ms end wf test a result is cut to fit a bridge string, keeping the counts and the status status=passed + 605.000 ms 21923.000ms end command install jasmine-core + 600.000 ms 2427.000ms end command dev watch/main.ts + 575.000 ms 2565.000ms end command dev watch/main.ts + 566.000 ms 21751.000ms end command install jasmine-core + 538.000 ms 21717.000ms end command install jasmine-core + 517.000 ms 11874.000ms end command run gen a + 515.000 ms 12557.000ms end command run gen a + 455.000 ms 21305.000ms end command check + 436.000 ms 12562.000ms end command run denied + 422.000 ms 3481.000ms end command build + 421.000 ms 3050.000ms end command build + 409.000 ms 12315.000ms end command run denied + 399.000 ms 20057.000ms end command check + 398.000 ms 22554.000ms end wf test #4 + 398.000 ms 22554.000ms end command test + 395.000 ms 22335.000ms end wf test #4 + 395.000 ms 22335.000ms end command test + 391.000 ms 21172.000ms end command check + 390.000 ms 21164.000ms end command check + 382.000 ms 19966.000ms end command check + 381.000 ms 12946.000ms end command run node + 375.000 ms 22363.000ms end wf test #4 + 375.000 ms 22363.000ms end command test + 368.000 ms 19979.000ms end command check + 368.000 ms 11258.000ms end command preview restore/main.js + 357.000 ms 3137.000ms end command build + 336.000 ms 2768.000ms end command build + 328.000 ms 3172.000ms end command build + 318.000 ms 1030.000ms end bootstrap ready + 314.000 ms 1000.000ms end bootstrap ready + 299.000 ms 1019.000ms end bootstrap ready + 290.000 ms 14260.000ms end command run --timeout 60 + 288.000 ms 12851.000ms end command run denied + 280.000 ms 24339.000ms end wf test #14 + 280.000 ms 24339.000ms end command test + 279.000 ms 12596.000ms end command run node + 277.000 ms 988.000ms end command install react@19.3.1 react-dom@19.3.1 + 277.000 ms 23307.000ms end wf test #7 + 277.000 ms 23307.000ms end command test + 275.000 ms 1019.000ms end command install react@19.3.1 react-dom@19.3.1 + 273.000 ms 24053.000ms end wf test #11 + 273.000 ms 24053.000ms end command test + 270.000 ms 2838.000ms end command build + 270.000 ms 13122.000ms end command run node + 268.000 ms 23829.000ms end wf test #9 + 268.000 ms 23829.000ms end command test + 266.000 ms 24097.000ms end wf test #10 --timeout 60 + 265.000 ms 24097.000ms end command test --timeout 60 + 265.000 ms 23705.000ms end wf test #10 --timeout 60 + 265.000 ms 23705.000ms end command test --timeout 60 + 265.000 ms 14946.000ms end command run big + 264.000 ms 14719.000ms end command run big + 263.000 ms 23534.000ms end wf test #9 + 263.000 ms 23534.000ms end command test + 263.000 ms 1007.000ms end command install react@19.3.1 react-dom@19.3.1 + 262.000 ms 12118.000ms end command run gen a + 260.000 ms 15179.000ms end command run big + 259.000 ms 13096.000ms end command run coop + 257.000 ms 23025.000ms end wf test #6 no such spec + 257.000 ms 23025.000ms end command test no such spec + 255.000 ms 15061.000ms end command exec webfront-fixture-tool hello + 251.000 ms 14680.000ms end command run jsx + 248.000 ms 23558.000ms end wf test #8 + 248.000 ms 23558.000ms end command test + 248.000 ms 22791.000ms end wf test #6 no such spec + 248.000 ms 22791.000ms end command test no such spec + 245.000 ms 14220.000ms end command run unawaited + 243.000 ms 23780.000ms end wf test #10 --timeout 60 + 243.000 ms 23780.000ms end command test --timeout 60 + 243.000 ms 14005.000ms end command run unawaited + 241.000 ms 14454.000ms end command run jsx + 239.000 ms 12836.000ms end command run fail + 238.000 ms 23032.000ms end wf test #7 + 238.000 ms 23032.000ms end command test + 236.000 ms 24578.000ms end wf test #14 + 236.000 ms 24578.000ms end command test + 236.000 ms 24334.000ms end wf test #11 + 236.000 ms 24334.000ms end command test + 235.000 ms 23269.000ms end wf test #8 + 235.000 ms 23023.000ms end wf test #7 + 235.000 ms 23023.000ms end command test + 234.000 ms 23268.000ms end command test + 233.000 ms 21985.000ms end wf test #3 + 233.000 ms 13558.000ms end command run --timeout 60 + 231.000 ms 23936.000ms end wf test #11 + 231.000 ms 21984.000ms end command test + 230.000 ms 24171.000ms end wf test #14 + 230.000 ms 23936.000ms end command test + 229.000 ms 24170.000ms end command test + 228.000 ms 22152.000ms end wf test #3 + 228.000 ms 13325.000ms end command run loop + 227.000 ms 22152.000ms end command test + 227.000 ms 15497.000ms end command exec webfront-fixture-tool hello + 227.000 ms 13972.000ms end command run --timeout 60 + 226.000 ms 13567.000ms end command run coop + 225.000 ms 14488.000ms end command run unawaited + 221.000 ms 22784.000ms end wf test #6 no such spec + 221.000 ms 22784.000ms end command test no such spec + 219.000 ms 21937.000ms end wf test #3 + 219.000 ms 21937.000ms end command test + 219.000 ms 14918.000ms end command run jsx + 218.000 ms 13340.000ms end command run fail + 214.000 ms 23438.000ms end wf test #9 + 214.000 ms 23438.000ms end command test + 213.000 ms 22768.000ms end wf test #5 passing + 213.000 ms 22768.000ms end command test passing + 213.000 ms 15243.000ms end command exec webfront-fixture-tool hello + 209.000 ms 14698.000ms end command run root + 207.000 ms 22543.000ms end wf test #5 passing + 207.000 ms 22543.000ms end command test passing + 207.000 ms 14428.000ms end command run root + 207.000 ms 14213.000ms end command run root + 207.000 ms 13357.000ms end command run coop + 204.000 ms 13150.000ms end command run fail + 203.000 ms 13970.000ms end command run --timeout 60 + 201.000 ms 13759.000ms end command run --timeout 60 + 201.000 ms 13745.000ms end command run --timeout 60 + 200.000 ms 22563.000ms end wf test #5 passing + 200.000 ms 22563.000ms end command test passing + 199.000 ms 13767.000ms end command run loop + 196.000 ms 23221.000ms end wf test #8 + 195.000 ms 23221.000ms end command test + 186.000 ms 13543.000ms end command run loop + 156.000 ms 3489.000ms end wf test a report is bounded: what the specs post is cut, not trusted status=passed + 155.000 ms 3739.000ms end wf test a report is bounded: what the specs post is cut, not trusted status=passed + 155.000 ms 3504.000ms end wf test a report is bounded: what the specs post is cut, not trusted status=passed + 149.000 ms 2026.000ms end wf run and wf exec context.exit stops the script at once, even when it is not awaited status=passed + 147.000 ms 2108.000ms end wf run and wf exec context.exit stops the script at once, even when it is not awaited status=passed + 146.000 ms 2661.000ms end wf dev one esbuild context reads changed imports, reports syntax errors and recovers status=passed + 141.000 ms 2279.000ms end wf run and wf exec context.exit stops the script at once, even when it is not awaited status=passed + 138.000 ms 2624.000ms end wf dev one esbuild context reads changed imports, reports syntax errors and recovers status=passed + 132.000 ms 2851.000ms end wf dev one esbuild context reads changed imports, reports syntax errors and recovers status=passed + 113.000 ms 740.000ms end wf restore the registry fixture is reproducible status=passed + 87.000 ms 683.000ms end wf restore the registry fixture is reproducible status=passed + 83.000 ms 717.000ms end wf restore the registry fixture is reproducible status=passed + 82.000 ms 11007.000ms end command restore + 78.000 ms 11086.000ms end command restore --offline + 76.000 ms 10900.000ms end command install + 76.000 ms 10798.000ms end command install --update + 71.000 ms 2425.000ms end wf run and wf exec an error keeps its message when the engine's stack holds only the frames, as in WebKit status=passed + 71.000 ms 10721.000ms end command install --update + 70.000 ms 2103.000ms end wf run and wf exec context.fetch rejects outside its permissions, accepts a Request and does not follow redirects status=passed + 69.000 ms 2172.000ms end wf run and wf exec an error keeps its message when the engine's stack holds only the frames, as in WebKit status=passed + 68.000 ms 2353.000ms end wf run and wf exec context.fetch rejects outside its permissions, accepts a Request and does not follow redirects status=passed + 68.000 ms 2251.000ms end wf run and wf exec an error keeps its message when the engine's stack holds only the frames, as in WebKit status=passed + 68.000 ms 2182.000ms end wf run and wf exec context.fetch rejects outside its permissions, accepts a Request and does not follow redirects status=passed + 66.000 ms 11198.000ms end command restore + 61.000 ms 15570.000ms end install TypeScript 4.9.5 + 59.000 ms 3802.000ms end wf test specs bundle in the manifest order with their imports, TypeScript and locked packages status=passed + 57.000 ms 15566.000ms end command install typescript@4.9.5 + 57.000 ms 11256.000ms end command restore --offline + 54.000 ms 747.000ms end wf run and wf exec a stop while a write is staging abandons it: the file is unchanged and no transaction remains status=passed + 53.000 ms 11110.000ms end command install + 52.000 ms 778.000ms end wf run and wf exec a stop while a write is staging abandons it: the file is unchanged and no transaction remains status=passed + 52.000 ms 3560.000ms end wf test specs bundle in the manifest order with their imports, TypeScript and locked packages status=passed + 51.000 ms 300.000ms end The project manifest a project locked before the manifest keeps its locked graph through wf init and wf install status=passed + 50.000 ms 10792.000ms end command install + 49.000 ms 280.000ms end The project manifest a project locked before the manifest keeps its locked graph through wf init and wf install status=passed + 48.000 ms 3593.000ms end Scoped browser deadlines freezes arbitrary deadlines and keeps real fallbacks inside and after the scope status=passed + 48.000 ms 3542.000ms end wf test specs bundle in the manifest order with their imports, TypeScript and locked packages status=passed + 47.000 ms 284.000ms end The project manifest a project locked before the manifest keeps its locked graph through wf init and wf install status=passed + 45.000 ms 15118.000ms end install TypeScript 4.9.5 + 44.000 ms 10862.000ms end command restore + 42.000 ms 3846.000ms end Scoped browser deadlines freezes arbitrary deadlines and keeps real fallbacks inside and after the scope status=passed + 42.000 ms 3605.000ms end Scoped browser deadlines freezes arbitrary deadlines and keeps real fallbacks inside and after the scope status=passed + 42.000 ms 15296.000ms end install TypeScript 4.9.5 + 42.000 ms 15116.000ms end command install typescript@4.9.5 + 41.000 ms 11037.000ms end command install --update + 40.000 ms 794.000ms end wf run and wf exec a stop while a write is staging abandons it: the file is unchanged and no transaction remains status=passed + 39.000 ms 15293.000ms end command install typescript@4.9.5 + 38.000 ms 3644.000ms end The developer distribution starter integrity, recipes and archive paths are checked before any project writes status=passed + 38.000 ms 14806.000ms end command install webfront-fixture-tool webfront-fixture-nodebin + 36.000 ms 15030.000ms end command install webfront-fixture-tool webfront-fixture-nodebin + 35.000 ms 359.000ms end The project manifest the three states of manifest and lock for install, install and install --update status=passed + 35.000 ms 110.000ms end The environment resolves transitive semver edges, cycles, multiple versions and required peers status=passed + 34.000 ms 15270.000ms end command install webfront-fixture-tool webfront-fixture-nodebin + 34.000 ms 106.000ms end The environment resolves transitive semver edges, cycles, multiple versions and required peers status=passed + 32.000 ms 2130.000ms end wf run and wf exec the time limit stops a script the same way, without Ctrl+C status=passed + 32.000 ms 1950.000ms end wf run and wf exec the time limit stops a script the same way, without Ctrl+C status=passed + 32.000 ms 1868.000ms end wf run and wf exec the time limit stops a script the same way, without Ctrl+C status=passed + 29.000 ms 221.000ms end The environment a C++ command whose start was acknowledged rejects when the connection closes, and unsubscribes status=passed + 28.000 ms 507.000ms end wf restore lock and empty cache: wf restore rebuilds the exact locked graph from the local registry status=passed + 28.000 ms 106.000ms end The environment resolves transitive semver edges, cycles, multiple versions and required peers status=passed + 27.000 ms 230.000ms end The environment a C++ command whose start was acknowledged rejects when the connection closes, and unsubscribes status=passed + 27.000 ms 214.000ms end The environment a C++ command whose start was acknowledged rejects when the connection closes, and unsubscribes status=passed + 27.000 ms 1917.000ms end wf run and wf exec Ctrl+C aborts the script cooperatively, then terminates one that does not stop status=passed + 27.000 ms 1835.000ms end wf run and wf exec Ctrl+C aborts the script cooperatively, then terminates one that does not stop status=passed + 27.000 ms 11905.000ms end command run listing + 27.000 ms 10889.000ms end command restore --offline + 26.000 ms 363.000ms end The project manifest the three states of manifest and lock for install, install and install --update status=passed + 26.000 ms 2097.000ms end wf run and wf exec Ctrl+C aborts the script cooperatively, then terminates one that does not stop status=passed + 26.000 ms 11824.000ms end command install webfront-fixture-absent + 24.000 ms 425.000ms end The project manifest wf install --update takes the newest version within the ranges while installing a package keeps the others status=passed + 24.000 ms 424.000ms end The project manifest wf install --update takes the newest version within the ranges while installing a package keeps the others status=passed + 24.000 ms 356.000ms end The project manifest the three states of manifest and lock for install, install and install --update status=passed + 24.000 ms 11951.000ms end command install webfront-fixture-absent + 23.000 ms 419.000ms end The project manifest wf install --update takes the newest version within the ranges while installing a package keeps the others status=passed + 23.000 ms 148.000ms end The environment reads the archives of DefinitelyTyped, rooted at the package name, and refuses any other mixed root (#316) status=passed + 23.000 ms 11333.000ms end command install webfront-fixture-absent + 22.000 ms 447.000ms end The project manifest a package installed by dist-tag keeps its version when another package is installed status=passed + 22.000 ms 3584.000ms end wf test bounds cleanup when the bridge never publishes the empty test directory status=passed + 22.000 ms 307.000ms end The project manifest a legacy lock also stays usable for wf install , and one that does not match is desynchronized status=passed + 22.000 ms 185.000ms end The environment environment integrity and protocol are checked before publication status=passed + 21.000 ms 591.000ms end wf restore the bound of the unpacked graph counts the cached packages and is checked before publishing status=passed + 21.000 ms 3348.000ms end wf test bounds cleanup when the bridge never publishes the empty test directory status=passed + 21.000 ms 3333.000ms end wf test bounds cleanup when the bridge never publishes the empty test directory status=passed + 20.000 ms 445.000ms end The project manifest a package installed by dist-tag keeps its version when another package is installed status=passed + 20.000 ms 439.000ms end The project manifest a package installed by dist-tag keeps its version when another package is installed status=passed + 20.000 ms 3866.000ms end The developer distribution starter integrity, recipes and archive paths are checked before any project writes status=passed + 20.000 ms 300.000ms end The project manifest a legacy lock also stays usable for wf install , and one that does not match is desynchronized status=passed + 20.000 ms 129.000ms end The environment rejects integrity, archive identity, traversal and installation scripts status=passed + 19.000 ms 527.000ms end wf restore wf restore --offline checks the cache without any request and lists what is missing or corrupted status=passed + 19.000 ms 147.000ms end The environment reads the archives of DefinitelyTyped, rooted at the package name, and refuses any other mixed root (#316) status=passed + 18.000 ms 513.000ms end wf restore wf restore --offline checks the cache without any request and lists what is missing or corrupted status=passed + 18.000 ms 497.000ms end wf restore wf restore --offline checks the cache without any request and lists what is missing or corrupted status=passed + 17.000 ms 612.000ms end wf restore a cached file larger than the bound is a corruption, listed offline and repaired online status=passed + 17.000 ms 531.000ms end wf restore the application registry takes precedence over the manifest one, which takes precedence over the default status=passed + 17.000 ms 147.000ms end The environment reads the archives of DefinitelyTyped, rooted at the package name, and refuses any other mixed root (#316) status=passed + 17.000 ms 125.000ms end The environment rejects integrity, archive identity, traversal and installation scripts status=passed + 16.000 ms 543.000ms end wf restore the application registry takes precedence over the manifest one, which takes precedence over the default status=passed + 16.000 ms 494.000ms end wf restore lock and empty cache: wf restore rebuilds the exact locked graph from the local registry status=passed + 16.000 ms 385.000ms end The project manifest two installations that read the same state cannot overwrite each other status=passed + 16.000 ms 128.000ms end The environment rejects integrity, archive identity, traversal and installation scripts status=passed + 16.000 ms 10817.000ms end command restore --offline + 15.000 ms 400.000ms end The project manifest an invalid manifest is reported before anything is resolved status=passed + 15.000 ms 176.000ms end The environment environment integrity and protocol are checked before publication status=passed + 14.000 ms 594.000ms end wf restore the bound of the unpacked graph counts the cached packages and is checked before publishing status=passed + 14.000 ms 579.000ms end wf restore an interrupted restore keeps the packages already restored and resumes with the others status=passed + 14.000 ms 562.000ms end wf restore the bound of the unpacked graph counts the cached packages and is checked before publishing status=passed + 14.000 ms 548.000ms end wf restore an interrupted restore keeps the packages already restored and resumes with the others status=passed + 14.000 ms 512.000ms end wf restore the application registry takes precedence over the manifest one, which takes precedence over the default status=passed + 14.000 ms 479.000ms end wf restore lock and empty cache: wf restore rebuilds the exact locked graph from the local registry status=passed + 14.000 ms 400.000ms end The project manifest an invalid manifest is reported before anything is resolved status=passed + 14.000 ms 386.000ms end The project manifest two installations that read the same state cannot overwrite each other status=passed + 14.000 ms 336.000ms end The project manifest wf install needs a manifest, then publishes manifest and lock together status=passed + 14.000 ms 332.000ms end The project manifest wf install needs a manifest, then publishes manifest and lock together status=passed + 14.000 ms 10923.000ms end command restore --offline + 13.000 ms 568.000ms end wf restore an interrupted restore keeps the packages already restored and resumes with the others status=passed + 13.000 ms 324.000ms end The project manifest wf install needs a manifest, then publishes manifest and lock together status=passed + 13.000 ms 314.000ms end The project manifest a legacy lock also stays usable for wf install , and one that does not match is desynchronized status=passed + 13.000 ms 171.000ms end The environment environment integrity and protocol are checked before publication status=passed + 12.000 ms 634.000ms end wf restore wf install of a consistent lock repairs a corrupted cache and names its registry status=passed + 12.000 ms 626.000ms end wf restore wf install of a consistent lock repairs a corrupted cache and names its registry status=passed + 12.000 ms 603.000ms end wf restore a cached file larger than the bound is a corruption, listed offline and repaired online status=passed + 12.000 ms 596.000ms end wf restore wf install of a consistent lock repairs a corrupted cache and names its registry status=passed + 12.000 ms 575.000ms end wf restore a cached file larger than the bound is a corruption, listed offline and repaired online status=passed + 12.000 ms 462.000ms end The project manifest kept in a directory of the project wf init and wf install write and read there, and leave the project root alone status=passed + 12.000 ms 395.000ms end The project manifest an invalid manifest is reported before anything is resolved status=passed + 12.000 ms 383.000ms end The project manifest two installations that read the same state cannot overwrite each other status=passed + 12.000 ms 369.000ms end The project manifest a changed archive is refused when restoring a locked graph status=passed + 11.000 ms 732.000ms end command create life + 11.000 ms 555.000ms end wf restore a changed archive or a package missing from the registry fails and keeps lock and valid cache intact status=passed + 11.000 ms 543.000ms end wf restore a bridge failure while reading a record is reported, not taken for a corrupted cache status=passed + 11.000 ms 533.000ms end wf restore a changed archive or a package missing from the registry fails and keeps lock and valid cache intact status=passed + 11.000 ms 371.000ms end The project manifest a changed archive is refused when restoring a locked graph status=passed + 10.000 ms 622.000ms end wf restore an invalid or absent lock is refused before any request or write status=passed + 10.000 ms 614.000ms end wf restore an invalid or absent lock is refused before any request or write status=passed + 10.000 ms 564.000ms end wf restore a changed archive or a package missing from the registry fails and keeps lock and valid cache intact status=passed + 10.000 ms 458.000ms end The project manifest kept in a directory of the project wf init and wf install write and read there, and leave the project root alone status=passed + 10.000 ms 451.000ms end The project manifest kept in a directory of the project wf init and wf install write and read there, and leave the project root alone status=passed + 10.000 ms 310.000ms end The project manifest wf install refuses a range the manifest cannot hold before resolving, and writes only what the user wrote status=passed + 10.000 ms 162.000ms end The environment generated gzip words decode to the exact resources and generation is reproducible status=passed + 10.000 ms 160.000ms end The environment generated gzip words decode to the exact resources and generation is reproducible status=passed + 10.000 ms 11962.000ms end command install INVALID-NPM-NAME + 10.000 ms 11835.000ms end command install INVALID-NPM-NAME + 10.000 ms 10817.000ms end command install + 9.000 ms 700.000ms end command create life + 9.000 ms 584.000ms end wf restore an invalid or absent lock is refused before any request or write status=passed + 9.000 ms 553.000ms end wf restore a bridge failure while reading a record is reported, not taken for a corrupted cache status=passed + 9.000 ms 522.000ms end wf restore a bridge failure while reading a record is reported, not taken for a corrupted cache status=passed + 9.000 ms 317.000ms end The project manifest wf install refuses a range the manifest cannot hold before resolving, and writes only what the user wrote status=passed + 8.000 ms 733.000ms end command create life + 8.000 ms 3602.000ms end The developer distribution starter integrity, recipes and archive paths are checked before any project writes status=passed + 8.000 ms 322.000ms end The project manifest wf install refuses a range the manifest cannot hold before resolving, and writes only what the user wrote status=passed + 8.000 ms 195.000ms end The environment a pinned cached environment bootstraps offline and failed refreshes preserve publications status=passed + 7.000 ms 24354.000ms end command run --timeout 60 + 7.000 ms 1959.000ms end wf run and wf exec a reply that arrives after the end of the run is not sent to the terminated Worker status=passed + 7.000 ms 157.000ms end The environment generated gzip words decode to the exact resources and generation is reproducible status=passed + 7.000 ms 15509.000ms end TypeScript checks + 7.000 ms 15073.000ms end TypeScript checks + 7.000 ms 12126.000ms end command run listing + 6.000 ms 370.000ms end The project manifest a changed archive is refused when restoring a locked graph status=passed + 6.000 ms 3611.000ms end The developer distribution Pages staging retains older versions and refuses different bytes under an existing version status=passed + 6.000 ms 2646.000ms end wf dev Ctrl+C during commit still displays the committed preview before stopping dev status=passed + 6.000 ms 24185.000ms end command run --timeout 60 + 6.000 ms 236.000ms end The environment a C++ command that exits, or is interrupted, removes its close listener status=passed + 6.000 ms 2136.000ms end wf run and wf exec a reply that arrives after the end of the run is not sent to the terminated Worker status=passed + 6.000 ms 192.000ms end The environment npm tarballs: package specs, integrity, bounded gunzip and tar entries status=passed + 6.000 ms 1874.000ms end wf run and wf exec a reply that arrives after the end of the run is not sent to the terminated Worker status=passed + 6.000 ms 187.000ms end The environment npm tarballs: package specs, integrity, bounded gunzip and tar entries status=passed + 6.000 ms 185.000ms end The environment a pinned cached environment bootstraps offline and failed refreshes preserve publications status=passed + 6.000 ms 180.000ms end The environment a pinned cached environment bootstraps offline and failed refreshes preserve publications status=passed + 6.000 ms 15254.000ms end TypeScript checks + 6.000 ms 11125.000ms end command restore --offline + 6.000 ms 10739.000ms end command install + 5.000 ms 753.000ms end wf run and wf exec the page answers context calls within the permissions and publishes each write status=passed + 5.000 ms 3873.000ms end The developer distribution Pages staging retains older versions and refuses different bytes under an existing version status=passed + 5.000 ms 3659.000ms end The developer distribution Life recipes select their generated provider and reject invalid provider names status=passed + 5.000 ms 3653.000ms end The developer distribution Pages staging retains older versions and refuses different bytes under an existing version status=passed + 5.000 ms 2857.000ms end wf dev polling compares read-time bytes and missing probes and ignores unrelated writes status=passed + 5.000 ms 2667.000ms end wf dev polling compares read-time bytes and missing probes and ignores unrelated writes status=passed + 5.000 ms 2631.000ms end wf dev polling compares read-time bytes and missing probes and ignores unrelated writes status=passed + 5.000 ms 203.000ms end The environment npm tarballs: package specs, integrity, bounded gunzip and tar entries status=passed + 5.000 ms 11339.000ms end command install INVALID-NPM-NAME + 5.000 ms 11055.000ms end command install + 5.000 ms 10807.000ms end command list + 5.000 ms 10733.000ms end command list + 4.000 ms 737.000ms end command create life + 4.000 ms 736.000ms end command create life + 4.000 ms 3878.000ms end The developer distribution Life recipes select their generated provider and reject invalid provider names status=passed + 4.000 ms 3617.000ms end The developer distribution Life recipes select their generated provider and reject invalid provider names status=passed + 4.000 ms 2867.000ms end wf dev Ctrl+C during commit still displays the committed preview before stopping dev status=passed + 4.000 ms 249.000ms end The project manifest wf init creates the root manifest every command reads, and never replaces it status=passed + 4.000 ms 24591.000ms end command run --timeout 60 + 4.000 ms 237.000ms end The project manifest wf init creates the root manifest every command reads, and never replaces it status=passed + 4.000 ms 231.000ms end The project manifest wf init creates the root manifest every command reads, and never replaces it status=passed + 4.000 ms 225.000ms end The environment a C++ command that exits, or is interrupted, removes its close listener status=passed + 4.000 ms 21313.000ms end wf test #1 + 4.000 ms 21180.000ms end wf test #1 + 4.000 ms 21180.000ms end command test + 4.000 ms 21179.000ms end wf test #2 + 4.000 ms 21179.000ms end command test + 4.000 ms 12562.000ms end command run listing + 3.000 ms 744.000ms end command init + 3.000 ms 742.000ms end command init + 3.000 ms 741.000ms end command init + 3.000 ms 711.000ms end command init + 3.000 ms 703.000ms end command create life + 3.000 ms 693.000ms end wf run and wf exec the page answers context calls within the permissions and publishes each write status=passed + 3.000 ms 3647.000ms end The developer distribution starter replacement refusal aborts the publication rather than overwriting files status=passed + 3.000 ms 3605.000ms end The developer distribution starter replacement refusal aborts the publication rather than overwriting files status=passed + 3.000 ms 3562.000ms end wf test reports cancellation and deadlines without AbortSignal.any and releases listeners and timers status=passed + 3.000 ms 3327.000ms end wf test reports cancellation and deadlines without AbortSignal.any and releases listeners and timers status=passed + 3.000 ms 3312.000ms end wf test reports cancellation and deadlines without AbortSignal.any and releases listeners and timers status=passed + 3.000 ms 2676.000ms end wf dev Ctrl+C during commit still displays the committed preview before stopping dev status=passed + 3.000 ms 24584.000ms end wf test #16 --timeout 60 + 3.000 ms 242.000ms end The project manifest invalid manifests are explicit errors, never silent fallbacks status=passed + 3.000 ms 218.000ms end The environment a C++ command that exits, or is interrupted, removes its close listener status=passed + 3.000 ms 21312.000ms end command test + 3.000 ms 21185.000ms end wf test #2 + 3.000 ms 21185.000ms end command test + 3.000 ms 21176.000ms end command list + 3.000 ms 21172.000ms end wf test #1 + 3.000 ms 21172.000ms end command test + 3.000 ms 21168.000ms end command list + 3.000 ms 2070.000ms end wf run and wf exec the exit code, console output and context replies of a run status=passed + 3.000 ms 1808.000ms end wf run and wf exec the exit code, console output and context replies of a run status=passed + 3.000 ms 15569.000ms end command check + 3.000 ms 15500.000ms end command exec webfront-fixture-nodebin + 3.000 ms 15246.000ms end command exec webfront-fixture-nodebin + 3.000 ms 11049.000ms end command list + 3.000 ms 1014.000ms end command list + 2.000 ms 996.000ms end command list + 2.000 ms 994.000ms end command list + 2.000 ms 744.000ms end command init + 2.000 ms 739.000ms end command install react@19.3.1 + 2.000 ms 738.000ms end command install react@19.3.1 + 2.000 ms 725.000ms end wf run and wf exec the page answers context calls within the permissions and publishes each write status=passed + 2.000 ms 708.000ms end command init + 2.000 ms 706.000ms end command install react@19.3.1 + 2.000 ms 3868.000ms end The developer distribution starter replacement refusal aborts the publication rather than overwriting files status=passed + 2.000 ms 3563.000ms end Scoped browser deadlines advances selected deadlines, preserves event-loop turns and restores globals on failure status=passed + 2.000 ms 2682.000ms end wf test a report counts exactly, names the failures and fails for anything but a pass status=passed + 2.000 ms 2652.000ms end wf test options: a time limit in whole seconds and one pattern status=passed + 2.000 ms 24580.000ms end wf test #15 + 2.000 ms 24341.000ms end wf test #15 + 2.000 ms 24340.000ms end wf test #12 --timeout 60 + 2.000 ms 24340.000ms end command test --timeout 60 + 2.000 ms 24178.000ms end wf test #17 + 2.000 ms 24176.000ms end wf test #16 --timeout 60 + 2.000 ms 24176.000ms end command test --timeout 60 + 2.000 ms 24173.000ms end wf test #15 + 2.000 ms 24057.000ms end wf test #12 --timeout 60 + 2.000 ms 24057.000ms end command test --timeout 60 + 2.000 ms 23941.000ms end wf test #13 + 2.000 ms 239.000ms end The project manifest a valid manifest receives its defaults and keeps a stable serialization status=passed + 2.000 ms 230.000ms end The project manifest invalid manifests are explicit errors, never silent fallbacks status=passed + 2.000 ms 2281.000ms end wf run and wf exec a write the script did not await completes after a normal end, and its failure is reported status=passed + 2.000 ms 228.000ms end The project manifest a valid manifest receives its defaults and keeps a stable serialization status=passed + 2.000 ms 225.000ms end The project manifest the dependency digest ignores key order and changes with any range status=passed + 2.000 ms 223.000ms end The project manifest invalid manifests are explicit errors, never silent fallbacks status=passed + 2.000 ms 221.000ms end The project manifest a valid manifest receives its defaults and keeps a stable serialization status=passed + 2.000 ms 21317.000ms end wf test #2 + 2.000 ms 21317.000ms end command test + 2.000 ms 21308.000ms end command list + 2.000 ms 2110.000ms end wf run and wf exec a write the script did not await completes after a normal end, and its failure is reported status=passed + 2.000 ms 2028.000ms end wf run and wf exec a write the script did not await completes after a normal end, and its failure is reported status=passed + 2.000 ms 1890.000ms end wf run and wf exec the exit code, console output and context replies of a run status=passed + 2.000 ms 1876.000ms end wf run and wf exec a refused commit is aborted too, so no transaction or staging is left behind status=passed + 2.000 ms 15508.000ms end command check + 2.000 ms 15502.000ms end command exec webfront-fixture-lib + 2.000 ms 15295.000ms end command check + 2.000 ms 15253.000ms end command check + 2.000 ms 15248.000ms end command exec webfront-fixture-lib + 2.000 ms 15118.000ms end command check + 2.000 ms 151.000ms end The environment resolves browser conditional exports and rejects private and Node imports status=passed + 2.000 ms 15073.000ms end command check + 2.000 ms 15066.000ms end command exec webfront-fixture-lib + 2.000 ms 15064.000ms end command exec webfront-fixture-nodebin + 2.000 ms 150.000ms end The environment resolves browser conditional exports and rejects private and Node imports status=passed + 2.000 ms 149.000ms end The environment resolves browser conditional exports and rejects private and Node imports status=passed + 2.000 ms 14263.000ms end command list + 2.000 ms 13974.000ms end command list + 2.000 ms 13762.000ms end command list + 2.000 ms 108.000ms end The environment an installed lock pins transitive versions and rejects changed archives status=passed + 2.000 ms 1025.000ms end command list + 2.000 ms 1016.000ms end command list + 1.000 ms 747.000ms end wf run and wf exec wf exec runs only a webfront.bin entry of a locked package status=passed + 1.000 ms 746.000ms end wf run and wf exec wf run resolves a script of the manifest to a module or a wf command, without a shell status=passed + 1.000 ms 744.000ms end wf run and wf exec context operations are checked against the manifest permissions status=passed + 1.000 ms 724.000ms end command create pi + 1.000 ms 723.000ms end wf run and wf exec Node.js built-in modules are recognized, with and without the node: prefix status=passed + 1.000 ms 722.000ms end wf run and wf exec wf exec runs only a webfront.bin entry of a locked package status=passed + 1.000 ms 721.000ms end command create pi + 1.000 ms 720.000ms end wf run and wf exec wf run resolves a script of the manifest to a module or a wf command, without a shell status=passed + 1.000 ms 719.000ms end wf run and wf exec context operations are checked against the manifest permissions status=passed + 1.000 ms 691.000ms end command create pi + 1.000 ms 690.000ms end wf run and wf exec Node.js built-in modules are recognized, with and without the node: prefix status=passed + 1.000 ms 689.000ms end wf run and wf exec wf exec runs only a webfront.bin entry of a locked package status=passed + 1.000 ms 687.000ms end wf run and wf exec wf run resolves a script of the manifest to a module or a wf command, without a shell status=passed + 1.000 ms 686.000ms end wf run and wf exec context operations are checked against the manifest permissions status=passed + 1.000 ms 544.000ms end wf restore a registry path never leaves the application origin, however a URL parser reads it status=passed + 1.000 ms 532.000ms end wf restore a registry path never leaves the application origin, however a URL parser reads it status=passed + 1.000 ms 513.000ms end wf restore a registry path never leaves the application origin, however a URL parser reads it status=passed + 1.000 ms 464.000ms end The project manifest kept in a directory of the project a script may not write the manifest or the lock there, whatever it is granted status=passed + 1.000 ms 463.000ms end The project manifest kept in a directory of the project a project without manifest in that directory has none, even with one at the root status=passed + 1.000 ms 461.000ms end The project manifest kept in a directory of the project a script may not write the manifest or the lock there, whatever it is granted status=passed + 1.000 ms 460.000ms end The project manifest kept in a directory of the project a project without manifest in that directory has none, even with one at the root status=passed + 1.000 ms 453.000ms end The project manifest kept in a directory of the project a script may not write the manifest or the lock there, whatever it is granted status=passed + 1.000 ms 452.000ms end The project manifest kept in a directory of the project a project without manifest in that directory has none, even with one at the root status=passed + 1.000 ms 450.000ms end The project manifest kept in a directory of the project a directory that is absolute, has an empty or dot component or leaves the project is refused and changes nothing status=passed + 1.000 ms 448.000ms end The project manifest kept in a directory of the project a directory that is absolute, has an empty or dot component or leaves the project is refused and changes nothing status=passed + 1.000 ms 447.000ms end The project manifest kept in a directory of the project the manifest and the lock are the files of that directory, and the root is the default status=passed + 1.000 ms 441.000ms end The project manifest kept in a directory of the project a directory that is absolute, has an empty or dot component or leaves the project is refused and changes nothing status=passed + 1.000 ms 440.000ms end The project manifest kept in a directory of the project the manifest and the lock are the files of that directory, and the root is the default status=passed + 1.000 ms 3874.000ms end The developer distribution bootstrap configuration is pinned and rejects unsafe version/base inputs status=passed + 1.000 ms 3804.000ms end Scoped browser deadlines advances selected deadlines, preserves event-loop turns and restores globals on failure status=passed + 1.000 ms 3654.000ms end The developer distribution bootstrap configuration is pinned and rejects unsafe version/base inputs status=passed + 1.000 ms 3558.000ms end wf test abortable stops waiting at once, whatever the promise waits for status=passed + 1.000 ms 3544.000ms end Scoped browser deadlines advances selected deadlines, preserves event-loop turns and restores globals on failure status=passed + 1.000 ms 3508.000ms end wf test the runner page loads the locked jasmine before the specs and the specs as a module status=passed + 1.000 ms 3507.000ms end wf test a result is the text on success and an error with the exit code and the report otherwise status=passed + 1.000 ms 3506.000ms end wf test the terminal text gives the summary, each failure with its frames, then the pending specs status=passed + 1.000 ms 3494.000ms end wf test the runner page loads the locked jasmine before the specs and the specs as a module status=passed + 1.000 ms 3493.000ms end wf test a result is the text on success and an error with the exit code and the report otherwise status=passed + 1.000 ms 3492.000ms end wf test the terminal text gives the summary, each failure with its frames, then the pending specs status=passed + 1.000 ms 3324.000ms end wf test abortable stops waiting at once, whatever the promise waits for status=passed + 1.000 ms 3309.000ms end wf test abortable stops waiting at once, whatever the promise waits for status=passed + 1.000 ms 2875.000ms end wf test failures of a suite (an afterAll) are collected, counted and shown status=passed + 1.000 ms 2874.000ms end wf test a report counts exactly, names the failures and fails for anything but a pass status=passed + 1.000 ms 2873.000ms end wf test specs come from the manifest and jasmine-core from the lock, at the version the project chose status=passed + 1.000 ms 2868.000ms end optional spec progress reports the started spec when the driver callback is available status=passed + 1.000 ms 2861.000ms end wf dev a compiler session reuses its Worker and serializes rebuilds status=passed + 1.000 ms 2860.000ms end wf dev Ctrl+C terminates an active compiler, rejects once, and drops late read answers status=passed + 1.000 ms 2858.000ms end wf dev a polling pass bounds bytes and paths, reports non-missing failures status=passed + 1.000 ms 2683.000ms end wf test failures of a suite (an afterAll) are collected, counted and shown status=passed + 1.000 ms 2680.000ms end wf test specs come from the manifest and jasmine-core from the lock, at the version the project chose status=passed + 1.000 ms 2678.000ms end optional spec progress keeps specs runnable without the driver callback or after disconnection status=passed + 1.000 ms 2677.000ms end optional spec progress reports the started spec when the driver callback is available status=passed + 1.000 ms 2670.000ms end wf dev Ctrl+C terminates an active compiler, rejects once, and drops late read answers status=passed + 1.000 ms 2669.000ms end wf dev a polling pass bounds bytes and paths, reports non-missing failures status=passed + 1.000 ms 2654.000ms end wf test a report counts exactly, names the failures and fails for anything but a pass status=passed + 1.000 ms 2653.000ms end wf test specs come from the manifest and jasmine-core from the lock, at the version the project chose status=passed + 1.000 ms 2650.000ms end optional spec progress handles a bridge that throws before returning its Promise status=passed + 1.000 ms 2649.000ms end optional spec progress keeps specs runnable without the driver callback or after disconnection status=passed + 1.000 ms 2648.000ms end optional spec progress reports the started spec when the driver callback is available status=passed + 1.000 ms 2636.000ms end wf dev build selects one explicit entry or every declared entry status=passed + 1.000 ms 2635.000ms end wf dev a compiler session reuses its Worker and serializes rebuilds status=passed + 1.000 ms 2634.000ms end wf dev Ctrl+C terminates an active compiler, rejects once, and drops late read answers status=passed + 1.000 ms 2632.000ms end wf dev a polling pass bounds bytes and paths, reports non-missing failures status=passed + 1.000 ms 24596.000ms end wf test #18 --timeout 0 + 1.000 ms 24585.000ms end wf test #17 + 1.000 ms 24585.000ms end command test + 1.000 ms 24583.000ms end command test --timeout 60 + 1.000 ms 24580.000ms end command test + 1.000 ms 245.000ms end The project manifest wf embed names the generated class after the provider, and refuses a file name that is not a C++ name status=passed + 1.000 ms 244.000ms end The project manifest entries are named in the manifest or given as paths status=passed + 1.000 ms 24360.000ms end wf test #18 --timeout 0 + 1.000 ms 24345.000ms end wf test #17 + 1.000 ms 24345.000ms end command test + 1.000 ms 24343.000ms end wf test #16 --timeout 60 + 1.000 ms 24343.000ms end command test --timeout 60 + 1.000 ms 24342.000ms end wf test #13 + 1.000 ms 24342.000ms end command test + 1.000 ms 24340.000ms end command test + 1.000 ms 243.000ms end The project manifest the dependency digest ignores key order and changes with any range status=passed + 1.000 ms 24191.000ms end wf test #19 a b + 1.000 ms 24191.000ms end command test a b + 1.000 ms 24190.000ms end wf test #18 --timeout 0 + 1.000 ms 24172.000ms end command test + 1.000 ms 24058.000ms end wf test #13 + 1.000 ms 24058.000ms end command test + 1.000 ms 23939.000ms end wf test #12 --timeout 60 + 1.000 ms 23939.000ms end command test --timeout 60 + 1.000 ms 233.000ms end The project manifest wf embed names the generated class after the provider, and refuses a file name that is not a C++ name status=passed + 1.000 ms 231.000ms end The project manifest the dependency digest ignores key order and changes with any range status=passed + 1.000 ms 2285.000ms end wf run and wf exec the script compiler reads package files on demand, only those it resolves status=passed + 1.000 ms 2283.000ms end wf run and wf exec a time limit also bounds the scripts run through wf commands status=passed + 1.000 ms 2282.000ms end wf run and wf exec the project root and the directories leading to granted paths are listable, filtered status=passed + 1.000 ms 2138.000ms end wf run and wf exec a refused commit is aborted too, so no transaction or staging is left behind status=passed + 1.000 ms 2114.000ms end wf run and wf exec the script compiler reads package files on demand, only those it resolves status=passed + 1.000 ms 2112.000ms end wf run and wf exec a time limit also bounds the scripts run through wf commands status=passed + 1.000 ms 2111.000ms end wf run and wf exec the project root and the directories leading to granted paths are listable, filtered status=passed + 1.000 ms 2033.000ms end wf run and wf exec the script compiler reads package files on demand, only those it resolves status=passed + 1.000 ms 2032.000ms end wf run and wf exec the Node.js import filter reaches the built-in modules whose names contain digits status=passed + 1.000 ms 2031.000ms end wf run and wf exec a locked name is looked up as an own key, and resolve() designates the package wf exec uses status=passed + 1.000 ms 2029.000ms end wf run and wf exec the project root and the directories leading to granted paths are listable, filtered status=passed + 1.000 ms 1960.000ms end wf run and wf exec a refused commit is aborted too, so no transaction or staging is left behind status=passed + 1.000 ms 196.000ms end The environment compressed downloads stop at their byte limit status=passed + 1.000 ms 186.000ms end The environment compressed downloads stop at their byte limit status=passed + 1.000 ms 186.000ms end The environment aborted publications never commit and clean their staging transaction status=passed + 1.000 ms 181.000ms end The environment compressed downloads stop at their byte limit status=passed + 1.000 ms 178.000ms end The environment aborted publications never commit and clean their staging transaction status=passed + 1.000 ms 173.000ms end The environment aborted publications never commit and clean their staging transaction status=passed + 1.000 ms 112.000ms end The environment an installed lock pins transitive versions and rejects changed archives status=passed + 1.000 ms 108.000ms end The environment an installed lock pins transitive versions and rejects changed archives status=passed + 1.000 ms 1027.000ms end command list + 0.000 ms 748.000ms end wf run and wf exec Node.js built-in modules are recognized, with and without the node: prefix status=passed + 0.000 ms 449.000ms end The project manifest kept in a directory of the project the manifest and the lock are the files of that directory, and the root is the default status=passed + 0.000 ms 3742.000ms end wf test the runner page loads the locked jasmine before the specs and the specs as a module status=passed + 0.000 ms 3741.000ms end wf test a result is the text on success and an error with the exit code and the report otherwise status=passed + 0.000 ms 3740.000ms end wf test the terminal text gives the summary, each failure with its frames, then the pending specs status=passed + 0.000 ms 3612.000ms end The developer distribution bootstrap configuration is pinned and rejects unsafe version/base inputs status=passed + 0.000 ms 2871.000ms end wf test options: a time limit in whole seconds and one pattern status=passed + 0.000 ms 2870.000ms end optional spec progress handles a bridge that throws before returning its Promise status=passed + 0.000 ms 2869.000ms end optional spec progress keeps specs runnable without the driver callback or after disconnection status=passed + 0.000 ms 2862.000ms end wf dev build selects one explicit entry or every declared entry status=passed + 0.000 ms 2679.000ms end wf test options: a time limit in whole seconds and one pattern status=passed + 0.000 ms 2678.000ms end optional spec progress handles a bridge that throws before returning its Promise status=passed + 0.000 ms 2672.000ms end wf dev build selects one explicit entry or every declared entry status=passed + 0.000 ms 2671.000ms end wf dev a compiler session reuses its Worker and serializes rebuilds status=passed + 0.000 ms 2655.000ms end wf test failures of a suite (an afterAll) are collected, counted and shown status=passed + 0.000 ms 24596.000ms end wf test #19 a b + 0.000 ms 24596.000ms end command test a b + 0.000 ms 24595.000ms end command test --timeout 0 + 0.000 ms 24360.000ms end wf test #19 a b + 0.000 ms 24360.000ms end command test a b + 0.000 ms 24359.000ms end command test --timeout 0 + 0.000 ms 24190.000ms end command test --timeout 0 + 0.000 ms 24177.000ms end command test + 0.000 ms 23940.000ms end command test + 0.000 ms 232.000ms end The project manifest entries are named in the manifest or given as paths status=passed + 0.000 ms 2284.000ms end wf run and wf exec the Node.js import filter reaches the built-in modules whose names contain digits status=passed + 0.000 ms 2283.000ms end wf run and wf exec a locked name is looked up as an own key, and resolve() designates the package wf exec uses status=passed + 0.000 ms 226.000ms end The project manifest wf embed names the generated class after the provider, and refuses a file name that is not a C++ name status=passed + 0.000 ms 225.000ms end The project manifest entries are named in the manifest or given as paths status=passed + 0.000 ms 2113.000ms end wf run and wf exec the Node.js import filter reaches the built-in modules whose names contain digits status=passed + 0.000 ms 2112.000ms end wf run and wf exec a locked name is looked up as an own key, and resolve() designates the package wf exec uses status=passed + 0.000 ms 2030.000ms end wf run and wf exec a time limit also bounds the scripts run through wf commands status=passed diff --git a/docs/test-performance/linux-after.txt b/docs/test-performance/linux-after.txt new file mode 100644 index 00000000..cacac313 --- /dev/null +++ b/docs/test-performance/linux-after.txt @@ -0,0 +1,3 @@ +Runs: 3 +Wall median: 93.000 s +Wall range: 92.000–93.000 s diff --git a/docs/test-performance/linux-before-1.dot b/docs/test-performance/linux-before-1.dot new file mode 100644 index 00000000..c37567b6 --- /dev/null +++ b/docs/test-performance/linux-before-1.dot @@ -0,0 +1,532 @@ +digraph ctest { + "WebFrontJsAssetsFresh"; + "FallbackIndexHtmlAssetFresh"; + "FallbackModuleAssetFresh"; + "FaviconAssetFresh"; + "DeveloperIndexHtmlAssetFresh"; + "DeveloperBootstrapAssetFresh"; + "MinimalCoreAssets"; + "MinimalCoreAssetsRejectsUnlisted"; + "EmbeddedAssetGenerator"; + "BundleInputsFresh"; + "BundleInputsRejectsChange"; + "NoNodeDependency"; + "NoNodeDependencyRejectsInjections"; + "CommandNamesAgree"; + "Scenario: HTTP rejects oversized fallback input before enqueue while preserving gzip pass-through"; + "Scenario: HTTP fallback rejects corrupt and truncated streams"; + "Scenario: Destroying WebFront closes its established WebSockets"; + "Scenario: Gzip decoding fills a preallocated bounded worker buffer without growing it"; + "Scenario: Destroying a server which is not running releases its connections"; + "Scenario: Accept-Encoding ignores unknown parameters while preserving q exclusions"; + "Scenario: NativeDebugFS opens an empty file"; + "Scenario: JsFunction"; + "Scenario: Gzip match copies preserve overlapping history across string growth"; + "Scenario: Printing a long text waits between its pieces"; + "Scenario: A failed write closes the WebSocket"; + "Scenario: A downloaded starter never replaces a developer's existing project"; + "Scenario: BasicWF initializes a custom frontend once"; + "Scenario: An embedded frontend blocks show until closure and completes the server loop"; + "Scenario: Printing waits while the browser has not read the output"; + "Scenario: HTTP Response"; + "Scenario: WebFront compiles after CEF's compiler macros"; + "Scenario: WebKitGTK applies navigation policy without toolkit objects"; + "Scenario: Request parsing"; + "Scenario: Content policy compares complete HTTP origins"; + "Scenario: WebLink settles correlated asynchronous results"; + "Scenario: The staging area is protected however its path is spelled"; + "Scenario: The environment learns whether the application chose the npm registry"; + "Scenario: A stopped server hands no connection over"; + "Scenario: WebLink forwards logs to the browser until a write fails"; + "Scenario: Accept-Encoding combines multiple fields before applying wildcard precedence"; + "Scenario: Developer writes are bounded and paths stay inside the explicit project"; + "Scenario: A group of files beyond the 260 characters of Windows is published together"; + "Scenario: NativeDebugFS root path handling"; + "Scenario: Failed gzip responses retain their job slot until the response lease is released"; + "Scenario: WebKitGTK retains the first session failure"; + "Scenario: The embedded assets of the core are the readable sources they are generated from"; + "Scenario: Frontend URLs use the configured listening address"; + "Scenario: Bitsets use canonical packed Uint8Array bytes at every size boundary"; + "Scenario: NativeDebugFS opens a binary file"; + "Scenario: A handler may own another subscription to the same browsers"; + "Scenario: Short WebSocket headers do not interpret payload bytes as an extended length"; + "Scenario: Shutdown drains running commands"; + "Scenario: Selecting WebView2 without support fails clearly"; + "Scenario: Selecting CEFFrontend without CEF support fails clearly"; + "Scenario: A C++ callback can receive the browser that called it"; + "Scenario: Browser result and cancellation can race"; + "Scenario: The frontend contract: open() runs on the calling thread and a closing frontend stops the server"; + "Scenario: A WebSocket rejects a frame announcing gigabytes before buffering it"; + "Scenario: Commands may outlive their registering object"; + "Scenario: HTTP preserves accepted gzip bytes"; + "Scenario: Accept-Encoding defaults to the identity fallback"; + "Scenario: Gzip work skips cancelled queued jobs and drains an active decode on stop"; + "Scenario: Empty wire strings are decoded without indexing past the input"; + "Scenario: Transactions abandoned by a disconnected browser never lock the project"; + "Scenario: MimeTypes"; + "Scenario: CEF subprocess exits preserve their status and diagnostic"; + "Scenario: A disconnected gzip requester leaves the shared decode usable by another browser"; + "Scenario: Commands register their bridge functions and list the commands"; + "Scenario: Accept-Encoding matches complete case-insensitive tokens with HTTP whitespace"; + "Scenario: Gzip CPU work coalesces revisions and bounds jobs, bytes and response leases"; + "Scenario: A rejected WebSocket Origin never reaches the server upgrade callback"; + "Scenario: Gzip lookahead retains prefetched bytes through alignment and bulk reads"; + "Scenario: Correlation exhaustion fails until an outstanding reply releases an ID"; + "Scenario: Uint8 arrays switch encoding at the compact-length boundary"; + "Scenario: HTTP rejects unavailable representations"; + "Scenario: The public version matches the version detected by CMake"; + "Scenario: HTTP considers explicit encoding preferences across fields"; + "Scenario: NativeDebugFS opens an existing text file using a relative path"; + "Scenario: Unknown HTTP methods have a safe display name"; + "Scenario: Gzip default output budget is four MiB across concatenated members"; + "Scenario: Function call correlation identifiers"; + "Scenario: Frontend exceptions propagate only after the server loop completes"; + "Scenario: TemporaryTestEnvironment destructor handles remove_all exception"; + "Scenario: A publication prepared from stale state is refused"; + "Scenario: Life generations follow B3/S23 synchronously"; + "Scenario: Handshake message"; + "Scenario: WebSocket decoder waits for an entire split payload"; + "Scenario: Embedded gzip assets are served to identity-only HTTP clients"; + "Scenario: Gzip work rejects saturation without starting a worker and preserves decode failures"; + "Scenario: SHA1 hashing"; + "Scenario: Wire integer conversion keeps truncation and handles 64-bit boundaries"; + "Scenario: C++ results too long for the wire reject the JavaScript Promise"; + "Scenario: A launching frontend leaves the server loop running after show returns"; + "Scenario: WebSocket header completeness follows its encoded length and mask"; + "Scenario: Typed browser senders report errors without escaping the receive loop"; + "Scenario: The default Life project is created once and then reused"; + "Scenario: WebLink dispatches every WebSocket frame coalesced in one read"; + "Scenario: WebSocket frames can own payloads for asynchronous writes"; + "Scenario: Gzip Huffman lookup preserves short tails, long codes and empty distance trees"; + "Scenario: Pending HTTP response buffers remain independent and announce connection closure"; + "Scenario: Gzip completion resumes on the supplied I/O scheduler"; + "Scenario: Stopping a running server releases its connections"; + "Scenario: Every MIME type has its own name"; + "Scenario: WebFrontLifeDeveloper starts without arguments"; + "Scenario: Selecting WKWebView without support fails clearly"; + "Scenario: Frontend selection aliases"; + "Scenario: Typed browser calls propagate receiver cancellation"; + "Scenario: Destruction waits safely after an explicit shutdown reports a pending external task"; + "Scenario: A writer resumes after a failed write reported the closure"; + "Scenario: Deduced cppFunction registration accepts common callable kinds"; + "Scenario: Validated gzip cache lifetime is owned and copies do not share application state"; + "Scenario: A gated cold gzip decode leaves HTTP and WebSocket upgrades responsive on the I/O thread"; + "Scenario: HTTP gzip workers preserve failure statuses and remain lazy on pass-through"; + "Scenario: A browser given the identifier of a disconnected one starts afresh"; + "Scenario: Logger"; + "Scenario: macOS CEF paths match the deployed framework layout"; + "Scenario: WebFrontConfig has newcomer-friendly defaults"; + "Scenario: Gzip fallback budgets preserve legacy buffer policy compatibility"; + "Scenario: Encoding bridge messages writes nothing to the standard output"; + "Scenario: Base64 encoding"; + "Scenario: Gzip buffered reads preserve logical byte offsets and exact member boundaries"; + "Scenario: WebKitGTK handles missing native navigation diagnostics"; + "Scenario: HTTP cache ownership and policy remain local to the application"; + "Scenario: A frontend startup failure before window creation completes the server loop"; + "Scenario: BasicWF does not require onUIStarted to be set"; + "Scenario: Validated gzip cache bounds keys and data and evicts the least recently used revision"; + "Scenario: Validated gzip cache never promotes invalid streams or trusts ISIZE alone"; + "Scenario: filesystem::Multi can combine multiple FileSystems"; + "Scenario: Bitset decoding rejects wrong types, lengths, padding and truncation"; + "Scenario: Gzip rejects reserved distance declarations and trailing padding"; + "Scenario: The default browser opens a quoted, encoded URL"; + "Scenario: A write failing after its WebLink is destroyed does not reach the link or its successor"; + "Scenario: Handlers may change the subscriptions while being notified"; + "Scenario: An embedded file reads the same bytes whatever the buffer size"; + "Scenario: Typed browser senders are lazy and own their arguments"; + "Scenario: RequestParser"; + "Scenario: HTTP treats stored x-gzip assets as gzip for fallback and pass-through"; + "Scenario: A browser that stops reading bounds the diagnostic frames queued for it"; + "Scenario: Typed browser senders can be awaited in a tracked task"; + "Scenario: WebFront passes per-application content rules to policy-aware frontends"; + "Scenario: Accept-Encoding accepts any positive duplicate regardless of order"; + "Scenario: Server drain joins its pending connection without draining unrelated work"; + "Scenario: A WebSocket reassembles the messages a browser sends in several frames"; + "Scenario: WebSocket decoder preserves coalesced frames"; + "Scenario: Scope drain waits for a concurrent spawn to finish starting"; + "Scenario: URI parsing"; + "Scenario: A committed publication that cannot be completed does not prevent opening the project"; + "Scenario: Each browser has its own commands"; + "Scenario: C++ function responders encode values and failures"; + "Scenario: Driver WebView2 profiles isolate environments served at identical URLs"; + "Scenario: The developer store refuses malformed requests without changing the project"; + "Scenario: A stopped WebSocket does not read again"; + "Scenario: NativeDebugFS opens a file in a subdirectory"; + "Scenario: Life wraps both axes without treating adjacent rows as neighbors"; + "Scenario: BufferOverflow"; + "Scenario: NativeDebugFS attempts to open a non-existent file"; + "Scenario: Failed frontend initialization is retried and success is shared across application types"; + "Scenario: A WebSocket limits the size of the messages it reassembles"; + "Scenario: Gzip decoding validates complete bounded members"; + "Scenario: Tracked task errors are logged and do not prevent joining"; + "Scenario: The developer bridge refuses WebSocket clients without an Origin"; + "Scenario: Frontend URLs preserve query and fragment syntax consistently"; + "Scenario: Command output is split under the bridge string limit on character boundaries"; + "Scenario: The environment learns where the application keeps the manifest"; + "Scenario: Embedded gzip assets are served to gzip-only HTTP clients"; + "Scenario: HTTP mutable providers cannot reuse stale identity content or HEAD lengths"; + "Scenario: HTTP server drains and destroys a populated fallback cache"; + "Scenario: HTTP requests keep method parsing state across interleaved receives"; + "Scenario: show opens the default page and returns when the window session ends"; + "Scenario: Accept-Encoding rejects malformed qvalues"; + "Scenario: HTTP version digits cannot overflow their integer fields"; + "Scenario: Accept-Encoding respects explicit and wildcard exclusions"; + "Scenario: HTTP Server forwards the application policy to gzip fallback"; + "Scenario: BasicWF forwards the configured address to address-aware frontends"; + "Scenario: WebSocket Headers decoding"; + "Scenario: Numeric arrays decode into fixed-size destinations"; + "Scenario: A project whose own directory exceeds the 260 characters of Windows can be opened"; + "Scenario: HTTP decodes gzip when the stored encoding is unavailable"; + "Scenario: Gzip coalescing isolates consumer cancellation and different output budgets"; + "Scenario: Application task cancellation returns to the server context"; + "Scenario: A copy of a context may outlive its command"; + "Scenario: A manifest and its lock are published together or not at all"; + "Scenario: Wire numbers outside an integer result range are rejected"; + "Scenario: BasicWF supports default construction"; + "Scenario: Startup cleanup never leaves the project through a staging link"; + "Scenario: WebLink dispatches browser messages and allocates distinct calls"; + "Scenario: Browser senders reject inconsistent return envelopes"; + "Scenario: Popup URLs remain literal arguments to desktop launchers"; + "Scenario: decodeParameter rejects malformed and mistyped payloads"; + "Scenario: HTTP encoding token comparison folds ASCII letters only"; + "Scenario: Content policy controls popup delegation"; + "Scenario: BasicWF provides the application facilities of commands"; + "Scenario: Gzip response leases enforce exact capacity accounting after CPU completion"; + "Scenario: New directories are durable once their parents are synchronized"; + "Scenario: An obsolete registration cannot cancel a replacement with the same wire ID"; + "Scenario: Subscriptions are move-only handles"; + "Scenario: A project path beyond the 260 characters of Windows is published and read like any other"; + "Scenario: WebLink rejects incomplete asynchronous results"; + "Scenario: Numeric arrays are encoded and decoded as owning values"; + "Scenario: URL encoding"; + "Scenario: Developer filesystem serves only published resources and protects the bridge"; + "Scenario: WebSocket decoder"; + "Scenario: FunctionCall"; + "Scenario: WebLink reports a browser's close frame as its disconnection"; + "Scenario: Gzip bulk reads require alignment and complete input"; + "Scenario: URI decoding"; + "Scenario: Malformed numeric array payloads are rejected"; + "Scenario: Gzip CRC32 matches standard and binary reference vectors"; + "Scenario: Gzip rejects invalid Huffman codes and match distances"; + "Scenario: The HTTP listener is ready before its event loop starts"; + "Scenario: HTTP rechecks the output budget after a suspended worker finishes"; + "Scenario: A link wakes a writer once its write queue drains"; + "Scenario: A stalled scope reports absent context work without abandoning its join"; + "Scenario: Paths differing only by case never share a staged file"; + "Scenario: The developer application needs an explicit project and a trusted environment"; + "Scenario: Developer publication preserves the installed files until commit"; + "Scenario: NativeDebugFS provides access to local files"; + "Scenario: NativeDebugFS opens a JSON configuration file"; + "Scenario: WebSocket Sec Key coding"; + "Scenario: RequestHandler ignores the query string of a request"; + "Scenario: A command may take its context by reference"; + "Scenario: TemporaryTestEnvironment::getBinaryData returns the correct binary data"; + "Scenario: A command streams its output and reports its exit"; + "Scenario: A sender reports a socket expiring independently of its correlation registry"; + "Scenario: Several handlers subscribe to connected browsers"; + "Scenario: Accept-Encoding treats x-gzip as the gzip alias"; + "Scenario: Paths from the browser stay inside their directory"; + "Scenario: Every frontend builds the application URL the same way"; + "Scenario: HTTP stop and disconnected clients cannot outlive the owned gzip worker"; + "Scenario: IndexFileSystem provides basic files for browser support"; + "Scenario: A failed accept does not stop the server from accepting"; + "Scenario: Registered C++ function handlers own and invoke their callable"; + "Scenario: A subscription may outlive its application"; + "Scenario: A frontend startup failure stops the server before propagating"; + "Scenario: WebSocket decoder preserves split extended headers and the following frame"; + "Scenario: Asynchronous Request parsing"; + "Scenario: WebSocket frame encoding"; + "Scenario: RequestHandler serves JavaScript modules"; + "Scenario: The driver deadline closes both connected and late browsers without losing the request"; + "Scenario: Cancelled correlation IDs cannot be reused before a late reply"; + "Scenario: RequestHandler on a HTTP GET"; + "Scenario: Packed bitsets retain owned bytes, tuple counts and the decoder cursor"; + "Scenario: cppFunction deduces a callable's signature from itself"; + "Scenario: BasicWF delegates window opening to the selected frontend"; + "Scenario: DefaultFS layers a configured document root over the embedded fallback"; + "Scenario: A UI first parameter selects the caller form of cppFunction"; + "Scenario: A project directory is listed without leaving the project"; + "Scenario: HTTP HEAD describes the negotiated representation"; + "Scenario: HTTP GET and HEAD reuse validated gzip revisions across paths and aliases"; + "Scenario: Applications own spawned coroutines and expose individual cancellation"; + "Scenario: TypeErasedFunctions"; + "Scenario: WebSocket frames encode extended payload lengths big-endian"; + "Scenario: A print task may be awaited after its context is gone"; + "Scenario: A second opener of the project waits for a publication in progress instead of abandoning it"; + "Scenario: The frontend contract: a failing open() stops the server whatever its action"; + "Scenario: Ctrl+C stops a running command and the next one runs at once"; + "Scenario: Validated gzip cache shares GET content and HEAD metadata within the current output budget"; + "Scenario: WebSocket upgrades authorize Origin before returning 101"; + "Scenario: A server scope can release the final owner of a WebSocket during cancellation"; + "Scenario: DefaultFS serves only embedded assets when no document root is configured"; + "Scenario: HTTP gzip fallback respects the configured decoded byte budget"; + "Scenario: FunctionReturn"; + "Scenario: The system browser session waits only after a successful launch"; + "Scenario: Accepted connections retain TCP_NODELAY through WebSocket upgrade"; + "Scenario: Spawn and scope close agree on whether work was accepted"; + "Scenario: WebSocket stop() is idempotent"; + "Scenario: New gzip consumers retry work skipped or interrupted by a decoder exception"; + "Scenario: Spawning during shutdown is rejected with a stopped handle"; + "Scenario: HTTP Request"; + "Scenario: Ack message"; + "Scenario: Strings beyond the 16-bit wire length are rejected instead of truncated"; + "Scenario: HTTP cached GET and HEAD recheck the active application output budget"; + "Scenario: Validated gzip cache permits empty streams under a zero output budget"; + "TestSuiteRepetition"; + "DoxygenDocumentation"; + "ReleaseVersionConsistency"; + "ReleaseVersionRegression"; + "BootstrapProvisioning"; + "NoAiAttributionRegression"; + "FrameBufferNotFormattedWhenDebugDisabled"; + "RepositoryLayout"; + "RepositoryLayoutRejectsVendoredSources"; + "NewcomerDocsMatchExamples"; + "FrontendSelection"; + "NativeAutodetectReconfiguration"; + "FrontendSelectionMultiConfig"; + "CEFTestingState"; + "CEFCopyDestinations"; + "WebView2UnsupportedToolchain"; + "WebView2LoaderArchitecture"; + "WKWebViewConfiguration"; + "AddSubdirectoryConsumer"; + "TransportBenchmarksAreManual"; + "ArchiveReleaseRejectsInvalidManifest"; + "WebProfileReset"; + "WebKitGTKLifecycle-no-bridge"; + "WebKitGTKLifecycle-early-close"; + "WebKitGTKLifecycle-rejected-ready"; + "WebKitGTKLifecycle-navigation-failure"; + "WebKitGTKLifecycle-path-encoding"; + "WebKitGTKLifecycle-content-policy"; + "WebKitGTKLifecycle-navigation-allow-list"; + "WebFrontWebKitGTKIntegration"; + "WebSuiteInstall" -> "WebFrontWebKitGTKIntegration"; + "WebKitGTKAdapter-no-display"; + "WebKitGTKAdapter-worker-thread"; + "WebKitGTKAdapter-native-close"; + "WebKitGTKAdapter-repeated-show"; + "WebKitGTKAdapter-http-error"; + "WebKitGTKAdapter-pre-run-failure"; + "WebKitGTKAdapter-profile-permissions"; + "WebKitGTKTransportContracts"; + "DeveloperBrowserIntegration"; + "WebProfileReset" -> "DeveloperBrowserIntegration"; + "DeveloperFixtures" -> "DeveloperBrowserIntegration"; + "WfDriverProject"; + "WfDriverInstall"; + "WfDriverProject" -> "WfDriverInstall"; + "DeveloperFixtures" -> "WfDriverInstall"; + "WfDriverTestPasses"; + "WfDriverProject" -> "WfDriverTestPasses"; + "WfDriverInstall" -> "WfDriverTestPasses"; + "DeveloperFixtures" -> "WfDriverTestPasses"; + "WfDriverTestFails"; + "WfDriverProject" -> "WfDriverTestFails"; + "WfDriverInstall" -> "WfDriverTestFails"; + "DeveloperFixtures" -> "WfDriverTestFails"; + "WfDriverCreateStarter"; + "WfDriverProject" -> "WfDriverCreateStarter"; + "DeveloperFixtures" -> "WfDriverCreateStarter"; + "WfDriverRenamedEntry"; + "WfDriverProject" -> "WfDriverRenamedEntry"; + "DeveloperFixtures" -> "WfDriverRenamedEntry"; + "WfDriverPinned"; + "WfDriverProject" -> "WfDriverPinned"; + "DeveloperFixtures" -> "WfDriverPinned"; + "WfDriverManifestDirectory"; + "WfDriverProject" -> "WfDriverManifestDirectory"; + "DeveloperFixtures" -> "WfDriverManifestDirectory"; + "WfDriverManifestDirectoryInstall"; + "WfDriverProject" -> "WfDriverManifestDirectoryInstall"; + "WfDriverManifestDirectory" -> "WfDriverManifestDirectoryInstall"; + "DeveloperFixtures" -> "WfDriverManifestDirectoryInstall"; + "WfDriverManifestDirectoryUnsafe"; + "WfDriverProject" -> "WfDriverManifestDirectoryUnsafe"; + "DeveloperFixtures" -> "WfDriverManifestDirectoryUnsafe"; + "WfDriverUnknownCommand"; + "WfDriverProject" -> "WfDriverUnknownCommand"; + "DeveloperFixtures" -> "WfDriverUnknownCommand"; + "WfDriverScriptOutput"; + "WfDriverProject" -> "WfDriverScriptOutput"; + "DeveloperFixtures" -> "WfDriverScriptOutput"; + "WfDriverTimeout"; + "WfDriverProject" -> "WfDriverTimeout"; + "DeveloperFixtures" -> "WfDriverTimeout"; + "WfDriverWrongIntegrity"; + "WfDriverProject" -> "WfDriverWrongIntegrity"; + "DeveloperFixtures" -> "WfDriverWrongIntegrity"; + "WfDriverMissingArchive"; + "WfDriverProject" -> "WfDriverMissingArchive"; + "DeveloperFixtures" -> "WfDriverMissingArchive"; + "WfDriverIncompatibleApi"; + "WfDriverProject" -> "WfDriverIncompatibleApi"; + "DeveloperFixtures" -> "WfDriverIncompatibleApi"; + "WfDriverIncompatibleProtocol"; + "WfDriverProject" -> "WfDriverIncompatibleProtocol"; + "DeveloperFixtures" -> "WfDriverIncompatibleProtocol"; + "WfDriverUsage"; + "WfDriverBadTimeout"; + "JourneyCreate"; + "WfDriverProject" -> "JourneyCreate"; + "DeveloperFixtures" -> "JourneyCreate"; + "JourneyInit"; + "WfDriverProject" -> "JourneyInit"; + "DeveloperFixtures" -> "JourneyInit"; + "JourneyCreate" -> "JourneyInit"; + "JourneyInstall"; + "JourneyInit" -> "JourneyInstall"; + "WfDriverProject" -> "JourneyInstall"; + "DeveloperFixtures" -> "JourneyInstall"; + "JourneyFiles"; + "JourneyInstall" -> "JourneyFiles"; + "JourneyCheck"; + "WfDriverProject" -> "JourneyCheck"; + "JourneyFiles" -> "JourneyCheck"; + "DeveloperFixtures" -> "JourneyCheck"; + "JourneyTest"; + "JourneyCheck" -> "JourneyTest"; + "WfDriverProject" -> "JourneyTest"; + "DeveloperFixtures" -> "JourneyTest"; + "JourneyBuild"; + "WfDriverProject" -> "JourneyBuild"; + "DeveloperFixtures" -> "JourneyBuild"; + "JourneyTest" -> "JourneyBuild"; + "JourneyEmbed"; + "JourneyBuild" -> "JourneyEmbed"; + "WfDriverProject" -> "JourneyEmbed"; + "DeveloperFixtures" -> "JourneyEmbed"; + "JourneyPermissionDenied"; + "WfDriverProject" -> "JourneyPermissionDenied"; + "JourneyEmbed" -> "JourneyPermissionDenied"; + "DeveloperFixtures" -> "JourneyPermissionDenied"; + "JourneyEmptyCache"; + "JourneyEmbed" -> "JourneyEmptyCache"; + "JourneyOfflineMissing"; + "JourneyEmptyCache" -> "JourneyOfflineMissing"; + "WfDriverProject" -> "JourneyOfflineMissing"; + "DeveloperFixtures" -> "JourneyOfflineMissing"; + "JourneyRestore"; + "JourneyOfflineMissing" -> "JourneyRestore"; + "WfDriverProject" -> "JourneyRestore"; + "DeveloperFixtures" -> "JourneyRestore"; + "JourneyOfflineVerified"; + "JourneyRestore" -> "JourneyOfflineVerified"; + "WfDriverProject" -> "JourneyOfflineVerified"; + "DeveloperFixtures" -> "JourneyOfflineVerified"; + "JourneyEmbeddedBuild"; + "JourneyEmbed" -> "JourneyEmbeddedBuild"; + "JourneyEmbeddedRun"; + "JourneyEmbeddedBuild" -> "JourneyEmbeddedRun"; + "WebSuiteProject"; + "WebSuiteInstall"; + "TestRegistry" -> "WebSuiteInstall"; + "WebSuiteProject" -> "WebSuiteInstall"; + "SelfBuildProject"; + "TestRegistry"; + "SelfBuildProject" -> "TestRegistry"; + "SelfBuildInstall"; + "TestRegistry" -> "SelfBuildInstall"; + "SelfBuildProject" -> "SelfBuildInstall"; + "SelfBuild"; + "SelfBuildInstall" -> "SelfBuild"; + "DeveloperSpecs"; + "SelfBuildInstall" -> "DeveloperSpecs"; + "SelfBuildRepeat"; + "SelfBuild" -> "SelfBuildRepeat"; + "SelfBuildOutsidePermissions"; + "SelfBuild" -> "SelfBuildOutsidePermissions"; + "SelfBuildReproducible"; + "SelfBuildRepeat" -> "SelfBuildReproducible"; + "DeveloperFixtures"; + "SelfBuild" -> "DeveloperFixtures"; + "SelfBuildRefresh"; + "SelfBuildReproducible" -> "SelfBuildRefresh"; + "SelfBuildRefreshMatchesSources"; + "SelfBuildRefresh" -> "SelfBuildRefreshMatchesSources"; + "SelfBuildSite"; + "SelfBuild" -> "SelfBuildSite"; + "SelfBuildSiteRepeat"; + "SelfBuildSite" -> "SelfBuildSiteRepeat"; + "SelfBuildSiteTamper"; + "SelfBuildSiteRepeat" -> "SelfBuildSiteTamper"; + "SelfBuildSiteRefusesChange"; + "SelfBuildSiteTamper" -> "SelfBuildSiteRefusesChange"; + "LifeEmbeddedBuild"; + "DeveloperBrowserIntegration" -> "LifeEmbeddedBuild"; + "LifeEmbeddedIntegration"; + "LifeEmbeddedBuild" -> "LifeEmbeddedIntegration"; + "lock: webfront_port_9002" -> "WebKitGTKLifecycle-no-bridge" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKLifecycle-early-close" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKLifecycle-rejected-ready" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKLifecycle-navigation-failure" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKLifecycle-path-encoding" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKLifecycle-content-policy" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKLifecycle-navigation-allow-list" [style=dashed]; + "lock: webfront_port_9002" -> "WebFrontWebKitGTKIntegration" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKAdapter-no-display" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKAdapter-worker-thread" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKAdapter-native-close" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKAdapter-repeated-show" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKAdapter-http-error" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKAdapter-pre-run-failure" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKAdapter-profile-permissions" [style=dashed]; + "lock: webfront_port_9002" -> "WebKitGTKTransportContracts" [style=dashed]; + "lock: webfront_port_9002" -> "DeveloperBrowserIntegration" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverInstall" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverTestPasses" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverTestFails" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverCreateStarter" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverRenamedEntry" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverPinned" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverManifestDirectory" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverManifestDirectoryInstall" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverManifestDirectoryUnsafe" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverUnknownCommand" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverScriptOutput" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverTimeout" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverWrongIntegrity" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverMissingArchive" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverIncompatibleApi" [style=dashed]; + "lock: webfront_port_9002" -> "WfDriverIncompatibleProtocol" [style=dashed]; + "lock: webfront_port_9002" -> "JourneyCreate" [style=dashed]; + "lock: webfront_port_9002" -> "JourneyInit" [style=dashed]; + "lock: webfront_port_9002" -> "JourneyInstall" [style=dashed]; + "lock: webfront_port_9002" -> "JourneyCheck" [style=dashed]; + "lock: webfront_port_9002" -> "JourneyTest" [style=dashed]; + "lock: webfront_port_9002" -> "JourneyBuild" [style=dashed]; + "lock: webfront_port_9002" -> "JourneyEmbed" [style=dashed]; + "lock: webfront_port_9002" -> "JourneyPermissionDenied" [style=dashed]; + "lock: webfront_port_9002" -> "JourneyOfflineMissing" [style=dashed]; + "lock: webfront_port_9002" -> "JourneyRestore" [style=dashed]; + "lock: webfront_port_9002" -> "JourneyOfflineVerified" [style=dashed]; + "lock: webfront_port_9002" -> "JourneyEmbeddedRun" [style=dashed]; + "lock: webfront_port_9002" -> "WebSuiteInstall" [style=dashed]; + "lock: webfront_port_9002" -> "TestRegistry" [style=dashed]; + "lock: webfront_port_9002" -> "SelfBuildInstall" [style=dashed]; + "lock: webfront_port_9002" -> "SelfBuild" [style=dashed]; + "lock: webfront_port_9002" -> "DeveloperSpecs" [style=dashed]; + "lock: webfront_port_9002" -> "SelfBuildRepeat" [style=dashed]; + "lock: webfront_port_9002" -> "SelfBuildOutsidePermissions" [style=dashed]; + "lock: webfront_port_9002" -> "SelfBuildRefresh" [style=dashed]; + "lock: webfront_port_9002" -> "SelfBuildSite" [style=dashed]; + "lock: webfront_port_9002" -> "SelfBuildSiteRepeat" [style=dashed]; + "lock: webfront_port_9002" -> "SelfBuildSiteRefusesChange" [style=dashed]; + "lock: webfront_port_9002" -> "LifeEmbeddedIntegration" [style=dashed]; + "lock: self-build-project" -> "SelfBuildProject" [style=dashed]; + "lock: self-build-project" -> "TestRegistry" [style=dashed]; + "lock: self-build-project" -> "SelfBuildInstall" [style=dashed]; + "lock: self-build-project" -> "SelfBuild" [style=dashed]; + "lock: self-build-project" -> "DeveloperSpecs" [style=dashed]; + "lock: self-build-project" -> "SelfBuildRepeat" [style=dashed]; + "lock: self-build-project" -> "SelfBuildOutsidePermissions" [style=dashed]; + "lock: self-build-project" -> "SelfBuildReproducible" [style=dashed]; + "lock: self-build-project" -> "DeveloperFixtures" [style=dashed]; + "lock: self-build-project" -> "SelfBuildRefresh" [style=dashed]; + "lock: self-build-project" -> "SelfBuildRefreshMatchesSources" [style=dashed]; + "lock: self-build-project" -> "SelfBuildSite" [style=dashed]; + "lock: self-build-project" -> "SelfBuildSiteRepeat" [style=dashed]; + "lock: self-build-project" -> "SelfBuildSiteTamper" [style=dashed]; + "lock: self-build-project" -> "SelfBuildSiteRefusesChange" [style=dashed]; +} diff --git a/docs/test-performance/linux-before-1.txt b/docs/test-performance/linux-before-1.txt new file mode 100644 index 00000000..0455694e --- /dev/null +++ b/docs/test-performance/linux-before-1.txt @@ -0,0 +1,35 @@ +CTest profile + +Cases: 365 +wall_seconds: 172.000 +sum_seconds: 211.259 +dependency_path_seconds: 52.852 +serial_seconds: 44.938 +lower_bound_seconds: 127.428 + +Slowest cases (seconds): + 29.819 DeveloperSpecs + 23.634 AddSubdirectoryConsumer + 22.845 JourneyEmbeddedBuild + 22.093 LifeEmbeddedBuild + 20.150 DeveloperBrowserIntegration + 4.320 SelfBuildRepeat + 4.316 SelfBuildRefresh + 4.248 SelfBuild + 4.234 WfDriverTimeout + 3.488 JourneyCheck + 3.369 CEFTestingState + 2.690 SelfBuildOutsidePermissions + 2.612 NoAiAttributionRegression + 2.565 JourneyEmbed + 2.461 TestRegistry + 2.035 JourneyInstall + 2.032 JourneyBuild + 1.969 SelfBuildInstall + 1.938 JourneyRestore + 1.852 LifeEmbeddedIntegration + 1.802 WebFrontWebKitGTKIntegration + 1.793 JourneyEmbeddedRun + 1.769 WfDriverRenamedEntry + 1.753 JourneyOfflineVerified + 1.710 FrontendSelection diff --git a/docs/test-performance/linux-before.txt b/docs/test-performance/linux-before.txt new file mode 100644 index 00000000..d7a0eb88 --- /dev/null +++ b/docs/test-performance/linux-before.txt @@ -0,0 +1,3 @@ +Runs: 1 +Wall median: 172.000 s +Wall range: 172.000–172.000 s diff --git a/include/webfront/WebFront.hpp b/include/webfront/WebFront.hpp index b2f6cd53..4a9dc667 100644 --- a/include/webfront/WebFront.hpp +++ b/include/webfront/WebFront.hpp @@ -295,6 +295,7 @@ auto makeCppFunctionResponder(Callable&& callable) { */ struct WebFrontConfig { std::string address{"127.0.0.1"}; + /// "0" requests an ephemeral port with TCPStdnet. The frontend receives the bound port. std::string port{"9002"}; std::filesystem::path documentRoot{}; ContentPolicy contentPolicy{}; @@ -315,7 +316,7 @@ class BasicWF { explicit BasicWF(WebFrontConfig config) : httpServer((detail::ensureFrontendInitialized(), config.address), config.port, config.documentRoot, config.contentPolicy), httpAddress(config.address), - httpPort(config.port), + httpPort(httpServer.port()), httpDocRoot(config.documentRoot), contentPolicy(std::move(config.contentPolicy)), idsCounter(0) { @@ -344,6 +345,9 @@ class BasicWF { explicit BasicWF(std::string_view port, std::filesystem::path docRoot = ".") : BasicWF(WebFrontConfig{.address = "0.0.0.0", .port = std::string(port), .documentRoot = std::move(docRoot)}) {} + /** @brief The listening port, including the OS-assigned TCPStdnet port when configured with "0". */ + std::string_view port() const noexcept { return httpPort; } + ~BasicWF() noexcept { stopAndJoinServer(); // Coroutine cleanup may use its UI, so links stay alive through the join. diff --git a/include/webfront/frontend/CEF.hpp b/include/webfront/frontend/CEF.hpp index dade6360..e5512616 100644 --- a/include/webfront/frontend/CEF.hpp +++ b/include/webfront/frontend/CEF.hpp @@ -538,7 +538,8 @@ class SimpleCEFApp : public CefApp, public CefBrowserProcessHandler { namespace detail { -inline void openWindow(std::string url, webfront::detail::BoundContentPolicy contentPolicy, CefRefPtr client = nullptr) { +inline void openWindow(std::string url, webfront::detail::BoundContentPolicy contentPolicy, + CefRefPtr client = nullptr, const std::filesystem::path& profile = {}) { setKeychainEnvironment(); // Build platform-appropriate CefMainArgs auto [argc, argv_vec] = getCommandLineArgs(); @@ -560,6 +561,13 @@ inline void openWindow(std::string url, webfront::detail::BoundContentPolicy con // Platform-specific path configuration configurePlatformPaths(settings); + if (!profile.empty()) { + const auto absoluteProfile = std::filesystem::absolute(profile); + std::filesystem::create_directories(absoluteProfile); + CefString(&settings.root_cache_path).FromString(absoluteProfile.string()); + CefString(&settings.cache_path).FromString(absoluteProfile.string()); + CefString(&settings.log_file).FromString((absoluteProfile / "cef_debug.log").string()); + } log::info("Attempting CEF initialization..."); CefRefPtr app(new SimpleCEFApp); if (!CefInitialize(main_args, settings, app.get(), nullptr)) { diff --git a/include/webfront/frontend/WKWebView.hpp b/include/webfront/frontend/WKWebView.hpp index c6976ceb..636e0196 100644 --- a/include/webfront/frontend/WKWebView.hpp +++ b/include/webfront/frontend/WKWebView.hpp @@ -18,6 +18,8 @@ struct WKWebViewOptions { /** @brief The initial document must finish loading within this interval; no bridge connection is required. */ std::chrono::milliseconds startupTimeout{30000}; ContentPolicy contentPolicy{}; + /** @brief Keep the native window hidden and avoid activating the application. A WindowServer is still required. */ + bool visible{true}; }; } // namespace webfront::frontend @@ -294,12 +296,21 @@ struct Session { attach(delegate, this); installed = true; send(app, "setDelegate:", delegate); - send(app, "setActivationPolicy:", applicationActivationPolicy()); + send(app, "setActivationPolicy:", options.visible ? applicationActivationPolicy() : 2L); installMenu(); send(app, "finishLaunching"); Object configuration(send(type("WKWebViewConfiguration"), "new")); send(configuration.get(), "setWebsiteDataStore:", send(type("WKWebsiteDataStore"), "nonPersistentDataStore")); + // Hidden content otherwise suspends once its load event completes. Use the public macOS 14+ preference + // so asynchronous bridge/Worker work and close requests keep progressing without a visible native window. + if (!options.visible) { + const auto preferences = send(configuration.get(), "preferences"); + const auto selector = sel_registerName("setInactiveSchedulingPolicy:"); + if (!send(preferences, "respondsToSelector:", selector)) + throw std::runtime_error("WKWebView: hidden sessions require macOS 14 or later (inactiveSchedulingPolicy)"); + send(preferences, "setInactiveSchedulingPolicy:", 2L); // WKInactiveSchedulingPolicyNone + } // Deliver script-created popup attempts to the delegates, which always cancel unmanaged views. send(send(configuration.get(), "preferences"), "setJavaScriptCanOpenWindowsAutomatically:", static_cast(true)); const CGRect bounds{ @@ -324,8 +335,10 @@ struct Session { send(window, "setContentView:", view); send(window, "makeFirstResponder:", view); send(window, "center"); - send(window, "makeKeyAndOrderFront:", static_cast(nullptr)); - send(app, "activateIgnoringOtherApps:", static_cast(true)); + if (options.visible) { + send(window, "makeKeyAndOrderFront:", static_cast(nullptr)); + send(app, "activateIgnoringOtherApps:", static_cast(true)); + } } void start() { diff --git a/include/webfront/frontend/WebView2.hpp b/include/webfront/frontend/WebView2.hpp index ec7566b7..d7f2e996 100644 --- a/include/webfront/frontend/WebView2.hpp +++ b/include/webfront/frontend/WebView2.hpp @@ -20,6 +20,8 @@ struct WebView2Options { std::chrono::milliseconds startupTimeout{std::chrono::seconds{30}}; std::filesystem::path userDataFolder{}; ContentPolicy contentPolicy{}; + /** @brief Keep the native window hidden while retaining the real controller and message loop. */ + bool visible{true}; }; } // namespace webfront::frontend @@ -259,7 +261,7 @@ class Session : public std::enable_shared_from_this { check(controller->put_Bounds(bounds), "resizing controller"); } - void createWindow() { + void createWindow(bool visible = true) { className = L"WebFront.WebView2." + std::to_wstring(reinterpret_cast(this)); WNDCLASSW windowClass{}; windowClass.lpfnWndProc = windowProcedure; @@ -288,7 +290,8 @@ class Session : public std::enable_shared_from_this { startupTimer = SetTimer(nullptr, 0, startupTimeoutMilliseconds, nullptr); if (!startupTimer) throw std::runtime_error("WebView2: cannot start startup timer"); - ShowWindow(window, SW_SHOW); + if (visible) + ShowWindow(window, SW_SHOW); } void start(const std::filesystem::path& profile, EnvironmentFactory createEnvironment = CreateCoreWebView2EnvironmentWithOptions) { @@ -613,7 +616,7 @@ inline void open(std::string_view address, prepare(*session); const auto profile = options.userDataFolder.empty() ? userDataFolder() : std::filesystem::absolute(options.userDataFolder); std::filesystem::create_directories(profile); - session->createWindow(); + session->createWindow(options.visible); session->start(profile); session->run(); } diff --git a/include/webfront/http/HTTPServer.hpp b/include/webfront/http/HTTPServer.hpp index 54d5bbba..0ca9082f 100644 --- a/include/webfront/http/HTTPServer.hpp +++ b/include/webfront/http/HTTPServer.hpp @@ -461,13 +461,10 @@ template(), std::move(decode)) { - const auto endpoint = Net::Resolve(address, port); - acceptor.open(endpoint.protocol()); - acceptor.set_option(typename Net::Acceptor::reuse_address(true)); - acceptor.bind(endpoint); - acceptor.listen(); spawn(acceptConnections()); } ~Server() noexcept { @@ -478,6 +475,11 @@ class Server { Server& operator=(const Server&) = delete; Server& operator=(Server&&) = delete; + /// The bound port, including the OS-assigned port when constructed with "0". + const std::string& port() const noexcept { + return listeningPort; + } + void run() { ioContext.run(); } void runOne() { ioContext.run_one(); } @@ -540,11 +542,27 @@ class Server { private: typename Net::IoContext ioContext; typename Net::Acceptor acceptor; + std::string listeningPort; networking::TaskScope tasks; RequestHandler requestHandler; - gzip::DecodeExecutor decodeExecutor; + gzip::DecodeExecutor decodeExecutor; std::function upgradeHandler; + std::string bind(std::string_view address, std::string_view requestedPort) { + const auto endpoint = Net::Resolve(address, requestedPort); + acceptor.open(endpoint.protocol()); + acceptor.set_option(typename Net::Acceptor::reuse_address(true)); + acceptor.bind(endpoint); + acceptor.listen(); + // Only the literal "0" asks for an OS-assigned port; any other value is already the port. + if (requestedPort != "0") + return std::string(requestedPort); + if constexpr (requires { acceptor.local_endpoint().port(); }) + return std::to_string(acceptor.local_endpoint().port()); + else + return std::string(requestedPort); // Preserve legacy providers/mocks which have no endpoint query. + } + void spawn(networking::Task task) { networking::Spawn(tasks, Net::Scheduler(acceptor), std::move(task)); } diff --git a/test/cmake/CheckFrontendSelection.cmake b/test/cmake/CheckFrontendSelection.cmake index 8f1bf702..f067d314 100644 --- a/test/cmake/CheckFrontendSelection.cmake +++ b/test/cmake/CheckFrontendSelection.cmake @@ -453,6 +453,9 @@ foreach(case webkitgtk-linux cef-linux cef-macos cef-windows cef-disabled missin if(case STREQUAL "cef-linux" OR case STREQUAL "extension" OR case STREQUAL "webkitgtk-linux") set(expected_command "${CMAKE_COMMAND};-a;${CMAKE_COMMAND}") endif() + if(case STREQUAL "webkitgtk-linux" OR case STREQUAL "cef-linux" OR case STREQUAL "extension") + set(expected_command "${ROOT}/test/tools/WithDisplay.sh;-a;${CMAKE_COMMAND}") + endif() if(test_name MATCHES "Lifecycle-(.+)$") list(APPEND expected_command "${CMAKE_MATCH_1}") endif() diff --git a/test/cmake/CheckTestSuiteRepetition.cmake b/test/cmake/CheckTestSuiteRepetition.cmake index 33f8b277..4590cf89 100644 --- a/test/cmake/CheckTestSuiteRepetition.cmake +++ b/test/cmake/CheckTestSuiteRepetition.cmake @@ -82,3 +82,50 @@ if(result EQUAL 0 OR EXISTS "${WORK}/build/test-results-2.xml" OR EXISTS "${WORK OR NOT "${output}${error}" MATCHES "Deliberate suite failure") message(FATAL_ERROR "The runner must stop at the first failed suite: ${output}${error}") endif() + +# Worker bounds are checked before CTest can accidentally choose unbounded parallelism. +foreach(parallel 0 -1 invalid) + execute_process(COMMAND "${CMAKE_COMMAND}" -DBUILD_DIR=${WORK}/build -DPARALLEL=${parallel} + -P "${ROOT}/test/cmake/RunTestSuite.cmake" RESULT_VARIABLE result OUTPUT_VARIABLE output ERROR_VARIABLE error) + if(result EQUAL 0 OR NOT "${output}${error}" MATCHES "PARALLEL must be a positive integer") + message(FATAL_ERROR "Invalid parallelism was not rejected: ${output}${error}") + endif() +endforeach() + +# A failed Xvfb launch is an unsuccessful invocation too: stale reports must already be gone. +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + file(WRITE "${WORK}/build/test-results-2.xml" "stale") + execute_process(COMMAND "${CMAKE_COMMAND}" -E env WEBFRONT_TEST_SHARED_DISPLAY=0 + "${CMAKE_COMMAND}" -DBUILD_DIR=${WORK}/build -DXVFB_RUN=${CMAKE_COMMAND} + -P "${ROOT}/test/cmake/RunTestSuite.cmake" RESULT_VARIABLE result OUTPUT_VARIABLE output ERROR_VARIABLE error) + if(result EQUAL 0 OR EXISTS "${WORK}/build/test-results-2.xml" + OR NOT EXISTS "${WORK}/build/test-results-manual.xml") + message(FATAL_ERROR "A failed display launch must discard only numbered stale reports: ${output}${error}") + endif() +endif() + +# A label exclusion leaves out the tests carrying it, and only them. +file(MAKE_DIRECTORY "${WORK}/labels/source") +file(WRITE "${WORK}/labels/source/CMakeLists.txt" [=[ +cmake_minimum_required(VERSION 3.31) +project(Labelled LANGUAGES NONE) +enable_testing() +add_test(NAME Standard COMMAND "${CMAKE_COMMAND}" -E true) +add_test(NAME Portable COMMAND "${CMAKE_COMMAND}" -E false) +set_tests_properties(Portable PROPERTIES LABELS portability) +]=]) +execute_process(COMMAND "${CMAKE_COMMAND}" -S "${WORK}/labels/source" -B "${WORK}/labels/build" + RESULT_VARIABLE result OUTPUT_VARIABLE output ERROR_VARIABLE error) +if(NOT result EQUAL 0) + message(FATAL_ERROR "Label fixture configure failed: ${output}${error}") +endif() +execute_process(COMMAND "${CMAKE_COMMAND}" -DBUILD_DIR=${WORK}/labels/build -DCONFIG=Release -DLABEL_EXCLUDE=portability + -P "${ROOT}/test/cmake/RunTestSuite.cmake" RESULT_VARIABLE result OUTPUT_VARIABLE output ERROR_VARIABLE error) +if(NOT result EQUAL 0 OR "${output}${error}" MATCHES "Portable") + message(FATAL_ERROR "The excluded label must not run: ${output}${error}") +endif() +execute_process(COMMAND "${CMAKE_COMMAND}" -DBUILD_DIR=${WORK}/labels/build -DCONFIG=Release + -P "${ROOT}/test/cmake/RunTestSuite.cmake" RESULT_VARIABLE result OUTPUT_VARIABLE output ERROR_VARIABLE error) +if(result EQUAL 0) + message(FATAL_ERROR "Without an exclusion the portability test must run and fail: ${output}${error}") +endif() diff --git a/test/cmake/DriverSessions.cmake b/test/cmake/DriverSessions.cmake new file mode 100644 index 00000000..76acb0d5 --- /dev/null +++ b/test/cmake/DriverSessions.cmake @@ -0,0 +1,63 @@ +# Keep each CTest assertion/filter name while amortizing the browser startup over compatible commands. +# Project mutations between sessions remain real CTest fixtures. OFF retains one process per case for diagnosis. +option(WEBFRONT_TEST_SESSIONS "Run compatible wf commands in one browser with fresh frames" ON) + +function(webfront_record_suite_case group name status command timeout) + # Words travel through CMake lists and JSON: refuse what they cannot carry instead of corrupting them. + if(command MATCHES "[\r\n\t]" OR command MATCHES ";") + message(FATAL_ERROR "Suite case ${name}: a command word contains a control or list character") + endif() + string(REPLACE "|" ";" words "${command}") + set(arguments "[]") + set(index 0) + foreach(word IN LISTS words) + string(REPLACE "\\" "\\\\" word "${word}") + string(REPLACE "\"" "\\\"" word "${word}") + string(JSON arguments SET "${arguments}" ${index} "\"${word}\"") + math(EXPR index "${index} + 1") + endforeach() + set(item "{}") + string(JSON item SET "${item}" name "\"${name}\"") + string(JSON item SET "${item}" expect "\"${status}\"") + string(JSON item SET "${item}" command "${arguments}") + string(JSON item SET "${item}" timeout "\"${timeout}\"") + get_property(total GLOBAL PROPERTY "wf-suite-timeout-${group}") + if(NOT total) + set(total 0) + endif() + math(EXPR total "${total} + ${timeout}") + set_property(GLOBAL PROPERTY "wf-suite-timeout-${group}" "${total}") + get_property(cases GLOBAL PROPERTY "wf-suite-${group}") + if(NOT cases) + set(cases "[]") + endif() + string(JSON length LENGTH "${cases}") + string(JSON cases SET "${cases}" ${length} "${item}") + set_property(GLOBAL PROPERTY "wf-suite-${group}" "${cases}") +endfunction() + +function(webfront_add_driver_suite group) + cmake_parse_arguments(ARG "PINNED" "PROJECT;MANIFEST_DIR" "REQUIRES" ${ARGN}) + get_property(cases GLOBAL PROPERTY "wf-suite-${group}") + if(NOT cases) + return() + endif() + set(suite "${CMAKE_CURRENT_BINARY_DIR}/driver-sessions/${group}.json") + file(GENERATE OUTPUT "${suite}" CONTENT "${cases}\n") + get_property(timeout GLOBAL PROPERTY "wf-suite-timeout-${group}") + math(EXPR ctest_timeout "${timeout} + 20") + set(options -DPROJECT=${ARG_PROJECT} -DMANIFEST_DIR=${ARG_MANIFEST_DIR} + -DSUITE=${suite} -DREPORT_DIR=${CMAKE_CURRENT_BINARY_DIR}/driver-sessions/${group} + -DPROFILE=${CMAKE_CURRENT_BINARY_DIR}/wf-profiles/${group} -DEXPECT_STATUS=0 -DTIMEOUT=${timeout}) + if(ARG_PINNED) + list(APPEND options -DENVIRONMENT= -DINTEGRITY=) + endif() + add_test(NAME ${group} COMMAND ${_wf_run} ${options} -P ${PROJECT_SOURCE_DIR}/test/cmake/RunWfDriver.cmake) + webfront_set_browser_test_properties(${group} "${CMAKE_CURRENT_SOURCE_DIR}" ${ctest_timeout}) + set(lock "${ARG_PROJECT}") + if(group STREQUAL "SelfBuildSession") + set(lock self-build-project) + endif() + set_tests_properties(${group} PROPERTIES FIXTURES_REQUIRED "${ARG_REQUIRES}" FIXTURES_SETUP ${group} + RESOURCE_LOCK "${lock}") +endfunction() diff --git a/test/cmake/PrepareEmptyProject.cmake b/test/cmake/PrepareEmptyProject.cmake new file mode 100644 index 00000000..6b146dfc --- /dev/null +++ b/test/cmake/PrepareEmptyProject.cmake @@ -0,0 +1,5 @@ +if(NOT PROJECT) + message(FATAL_ERROR "PROJECT is required") +endif() +file(REMOVE_RECURSE "${PROJECT}") +file(MAKE_DIRECTORY "${PROJECT}") diff --git a/test/cmake/RunTestSuite.cmake b/test/cmake/RunTestSuite.cmake index 55c446cc..5caa65d6 100644 --- a/test/cmake/RunTestSuite.cmake +++ b/test/cmake/RunTestSuite.cmake @@ -13,10 +13,22 @@ endif() cmake_path(ABSOLUTE_PATH BUILD_DIR NORMALIZE) get_filename_component(cmake_bin "${CMAKE_COMMAND}" DIRECTORY) find_program(CTEST_EXECUTABLE ctest HINTS "${cmake_bin}" REQUIRED) -set(options --test-dir "${BUILD_DIR}" --output-on-failure --no-tests=error --parallel 4) +# A bounded default; override for measured CPU/RAM limits without editing the script. +if(NOT DEFINED PARALLEL) + set(PARALLEL 4) +endif() +if(NOT PARALLEL MATCHES "^[1-9][0-9]*$") + message(FATAL_ERROR "PARALLEL must be a positive integer") +endif() +set(options --test-dir "${BUILD_DIR}" --output-on-failure --no-tests=error --parallel "${PARALLEL}" + --test-output-size-passed 2097152 --test-output-size-failed 2097152) if(CONFIG) list(APPEND options -C "${CONFIG}") endif() +# Labels (docs/TEST_TIERS.md): the standard tier excludes the portability tests that the weekly and master runs add back. +if(LABEL_EXCLUDE) + list(APPEND options -LE "${LABEL_EXCLUDE}") +endif() # A reused build directory must only expose reports from this invocation. file(GLOB previous_reports LIST_DIRECTORIES FALSE "${BUILD_DIR}/test-results-*.xml") foreach(report IN LISTS previous_reports) @@ -25,10 +37,35 @@ foreach(report IN LISTS previous_reports) file(REMOVE "${report}") endif() endforeach() +file(GLOB previous_logs LIST_DIRECTORIES FALSE "${BUILD_DIR}/Testing/Temporary/LastTest-*.log") +foreach(log IN LISTS previous_logs) + get_filename_component(log_name "${log}" NAME) + if(log_name MATCHES "^LastTest-[1-9][0-9]*\\.log$") + file(REMOVE "${log}") + endif() +endforeach() +# One dedicated display for the entire fixture graph, reused by all compatible browser processes. +# Direct ctest invocations retain per-process xvfb-run isolation and never open windows on the user's display. +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND NOT "$ENV{WEBFRONT_TEST_SHARED_DISPLAY}" STREQUAL "1") + find_program(XVFB_RUN xvfb-run) + if(XVFB_RUN) + execute_process(COMMAND "${CMAKE_COMMAND}" -E env WEBFRONT_TEST_SHARED_DISPLAY=1 + "${XVFB_RUN}" -a "${CMAKE_COMMAND}" -DBUILD_DIR=${BUILD_DIR} -DCONFIG=${CONFIG} + -DREPEAT=${REPEAT} -DPARALLEL=${PARALLEL} "-DLABEL_EXCLUDE=${LABEL_EXCLUDE}" -P "${CMAKE_CURRENT_LIST_FILE}" RESULT_VARIABLE status) + if(NOT status EQUAL 0) + message(FATAL_ERROR "CTest suite failed: ${status}") + endif() + return() + endif() +endif() foreach(pass RANGE 1 ${REPEAT}) message(STATUS "CTest suite pass ${pass}/${REPEAT}") execute_process(COMMAND "${CTEST_EXECUTABLE}" ${options} --output-junit "${BUILD_DIR}/test-results-${pass}.xml" RESULT_VARIABLE result) + if(EXISTS "${BUILD_DIR}/Testing/Temporary/LastTest.log") + file(COPY_FILE "${BUILD_DIR}/Testing/Temporary/LastTest.log" + "${BUILD_DIR}/Testing/Temporary/LastTest-${pass}.log") + endif() if(NOT result EQUAL 0) message(FATAL_ERROR "CTest suite pass ${pass}/${REPEAT} failed: ${result}") endif() diff --git a/test/cmake/RunWfDriver.cmake b/test/cmake/RunWfDriver.cmake index d5ca1e0e..7978ab19 100644 --- a/test/cmake/RunWfDriver.cmake +++ b/test/cmake/RunWfDriver.cmake @@ -11,8 +11,18 @@ # modules it loaded by URL, and the first page that loads another environment through the same profile fails with # "Importing a module script failed". Every case then starts from nothing. # FORGE replaces ENVIRONMENT with an archive whose environment.json declares the given protocol and API versions. +if(CASE_REPORT) + if(NOT EXISTS "${CASE_REPORT}") + message(FATAL_ERROR "No result for the suite case: ${CASE_REPORT}") + endif() + file(READ "${CASE_REPORT}" result) + string(JSON status GET "${result}" exitCode) + string(JSON output GET "${result}" output) + set(report "${CASE_REPORT}") +else() if(PROFILE) file(REMOVE_RECURSE "${PROFILE}") + set(ENV{WEBFRONT_TEST_CEF_PROFILE} "${PROFILE}/cef") set(ENV{XDG_DATA_HOME} "${PROFILE}/data") set(ENV{XDG_CACHE_HOME} "${PROFILE}/cache") # A fresh native profile also isolates WebView2 HTTP/module caches and lingering @@ -107,9 +117,16 @@ endif() if(EXPECT_FILE) file(REMOVE "${PROJECT}/${EXPECT_FILE}") endif() -string(REPLACE "|" ";" command "${COMMAND}") -execute_process(COMMAND "${DRIVER}" ${arguments} -- ${command} +if(SUITE) + list(APPEND arguments --suite "${SUITE}" --report-dir "${REPORT_DIR}") + set(command) +else() + string(REPLACE "|" ";" command "${COMMAND}") + list(APPEND arguments --) +endif() +execute_process(COMMAND "${DRIVER}" ${arguments} ${command} RESULT_VARIABLE status OUTPUT_VARIABLE output ERROR_VARIABLE errors) +endif() set(text "${output}${errors}") message(STATUS "exit status ${status}\n${text}") if(NOT status EQUAL EXPECT_STATUS) diff --git a/test/developer/specs/testing-specs.mjs b/test/developer/specs/testing-specs.mjs index 05d8ecff..9c5bad72 100644 --- a/test/developer/specs/testing-specs.mjs +++ b/test/developer/specs/testing-specs.mjs @@ -2,14 +2,17 @@ import {parseTestOptions, specFiles, jasmineCore, buildReport, formatReport, reportResult, runnerFiles, fitResult, abortable} from '../../../js/developer/environment/testing.mjs'; import {execute} from '../../../js/developer/environment/runtime.mjs'; import {bundleTests} from '../../../js/developer/environment/bundler.mjs'; -import {rejects, throws, esbuild, reportSpecStarted} from '../support.mjs'; +import {rejects, throws, esbuild, reportSpecStarted, reportSpecDone} from '../support.mjs'; describe('optional spec progress', () => { it('reports the started spec when the driver callback is available', async () => { const calls = []; const bridge = {cppFunction: name => async fullName => { calls.push([name, fullName]); }}; await reportSpecStarted(bridge, {fullName: 'suite spec'}); - expect(calls).toEqual([['wf.progress', 'suite spec']]); + await reportSpecDone(bridge, {fullName: 'suite spec', status: 'passed'}); + expect(calls.map(call => call[0])).toEqual(['wf.progress', 'wf.progress']); + expect(calls[0][1]).toMatch(/^\d+\.\d+ms begin suite spec$/); + expect(calls[1][1]).toMatch(/^\d+\.\d+ms end suite spec status=passed durationMs=\d+\.\d+$/); }); it('keeps specs runnable without the driver callback or after disconnection', async () => { diff --git a/test/developer/support.mjs b/test/developer/support.mjs index 033d8aab..9669ca1f 100644 --- a/test/developer/support.mjs +++ b/test/developer/support.mjs @@ -4,20 +4,28 @@ // rejects(promise, expected) and throws(callback, expected) check that the promise rejects or the callback throws, then // that the error satisfies `expected`: a RegExp tested against String(error), a function returning true for the error, // or nothing. -// Keep the last started spec in the driver's output even if its page stops reporting. -/** Optional driver diagnostics must never change a spec's result. */ +// Optional diagnostics use browser monotonic time, including the time spent awaiting setup/cleanup. +const now = performance.now.bind(performance); +const starts = new Map(); export async function reportSpecStarted(bridge, {fullName}) { + starts.set(fullName, now()); + return reportSpecEvent(bridge, `begin ${fullName}`); +} +export async function reportSpecDone(bridge, {fullName, status}) { + const start = starts.get(fullName); + starts.delete(fullName); + return reportSpecEvent(bridge, `end ${fullName} status=${status} durationMs=${start === undefined ? 'unknown' : (now() - start).toFixed(3)}`); +} +async function reportSpecEvent(bridge, message) { try { - await bridge.cppFunction('wf.progress')(fullName); + await bridge.cppFunction('wf.progress')(`${now().toFixed(3)}ms ${message}`); } catch { // Ordinary developer applications have no driver callback; diagnostics are best effort. } } - if (globalThis.webFront) jasmine.getEnv().addReporter({ - specStarted(result) { - return reportSpecStarted(webFront, result); - }, + specStarted: result => reportSpecStarted(webFront, result), + specDone: result => reportSpecDone(webFront, result), }); function satisfies(error, expected) { @@ -110,7 +118,9 @@ export function esbuild() { const lock = JSON.parse(await projectText('js/developer/webfront-packages.lock.json')); const key = lock.packages[lock.roots['esbuild-wasm'].id].key; const wasmModule = await WebAssembly.compile(await projectBytes(`.webfront/developer/packages/${key}/esbuild.wasm`)); - await esbuildWasm.initialize({wasmModule, worker: false}); + // WebKit throttles Go's scheduler timers in an off-screen iframe. Keep esbuild in its own Worker, + // as the real developer environment does; the same real WASM compiler and assertions still run. + await esbuildWasm.initialize({wasmModule, worker: true}); return esbuildWasm; })(); return initialized; diff --git a/test/driver/DriverSuite.hpp b/test/driver/DriverSuite.hpp new file mode 100644 index 00000000..5e9e29ca --- /dev/null +++ b/test/driver/DriverSuite.hpp @@ -0,0 +1,117 @@ +#pragma once + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace webfront::testdriver { +struct SuiteCase { + std::string name; + std::vector command; + int expected = 0; + std::chrono::seconds timeout{100}; +}; + +// A deliberately small schema: expected status is a decimal string, commands are argv arrays, never shell text. +inline std::vector parseSuite(std::string_view source, std::string_view filter = {}) { + std::vector cases; + std::set names; + json::Reader reader{source}; + reader.array([&] { + SuiteCase item; + reader.object([&](const std::string& key) { + if (key == "name") + item.name = reader.string(); + else if (key == "command") + reader.array([&] { + item.command.push_back(reader.string()); + }); + else if (key == "expect") { + const auto value = reader.string(); + const auto [end, error] = std::from_chars(value.data(), value.data() + value.size(), item.expected); + if (error != std::errc{} || end != value.data() + value.size() || item.expected < 0 || item.expected > 255) + throw std::invalid_argument("Suite expect must be a decimal exit status from 0 to 255"); + } else if (key == "timeout") { + const auto value = reader.string(); + long seconds = 0; + const auto [end, error] = std::from_chars(value.data(), value.data() + value.size(), seconds); + if (error != std::errc{} || end != value.data() + value.size() || seconds < 1 || seconds > 86400) + throw std::invalid_argument("Suite timeout must be whole seconds from 1 to 86400"); + item.timeout = std::chrono::seconds(seconds); + } else + throw std::invalid_argument("Unknown suite member: " + key); + }); + if (item.name.empty() || item.name.find_first_not_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_") != std::string::npos + || !names.insert(item.name).second || item.command.empty()) + throw std::invalid_argument("Suite cases need unique file-safe names and nonempty commands"); + if (filter.empty() || item.name.find(filter) != std::string::npos) + cases.push_back(std::move(item)); + }); + reader.end(); + if (cases.empty()) + throw std::invalid_argument("No suite case matches the filter"); + return cases; +} + +// The native watchdog keeps both the whole-session budget and the original per-case limit, including when +// a spec blocks JavaScript so neither the parent frame nor a JS timer can report an expired command. +class DriverDeadline { +public: + explicit DriverDeadline(std::chrono::steady_clock::duration total) : overall(std::chrono::steady_clock::now() + total), current(overall) {} + void beginCase(std::chrono::steady_clock::duration timeout) { + std::scoped_lock lock{mutex}; + current = std::min(overall, std::chrono::steady_clock::now() + timeout); + ++revision; + changed.notify_all(); + } + void endCase() { + std::scoped_lock lock{mutex}; + current = overall; + ++revision; + changed.notify_all(); + } + bool expired(std::stop_token stop) { + std::unique_lock lock{mutex}; + while (!stop.stop_requested()) { + const auto previous = revision; + const auto limit = current; + if (!changed.wait_until(lock, stop, limit, [&] { + return previous != revision; + })) + return !stop.stop_requested(); + } + return false; + } + +private: + const std::chrono::steady_clock::time_point overall; + std::chrono::steady_clock::time_point current; + std::size_t revision = 0; + std::mutex mutex; + std::condition_variable_any changed; +}; + +inline std::string readSuite(const std::filesystem::path& path) { + std::ifstream file(path, std::ios::binary); + if (!file) + throw std::invalid_argument("Cannot read suite: " + path.string()); + const auto size = std::filesystem::file_size(path); + if (size > 1024 * 1024) + throw std::invalid_argument("Suite exceeds 1 MiB: " + path.string()); + std::string source(static_cast(size), '\0'); + if (!source.empty() && !file.read(source.data(), static_cast(source.size()))) + throw std::invalid_argument("Truncated suite: " + path.string()); + return source; +} +} // namespace webfront::testdriver diff --git a/test/driver/TestFrontend.hpp b/test/driver/TestFrontend.hpp new file mode 100644 index 00000000..88f3caf8 --- /dev/null +++ b/test/driver/TestFrontend.hpp @@ -0,0 +1,45 @@ +#pragma once +#include + +#include +#include + +namespace webfront::testdriver { +inline bool diagnosticWindows() { +#ifdef _MSC_VER + char* raw = nullptr; + std::size_t size = 0; + if (_dupenv_s(&raw, &size, "WEBFRONT_TEST_VISIBLE") != 0) + throw std::runtime_error("Cannot read WEBFRONT_TEST_VISIBLE"); + const std::unique_ptr value(raw, std::free); + return value && std::string_view(value.get()) == "1"; +#else + const auto* value = std::getenv("WEBFRONT_TEST_VISIBLE"); + return value && std::string_view(value) == "1"; +#endif +} + +template +struct QuietFrontend : Frontend { + using Frontend::open; + static void open(std::string_view port, std::string_view page) { + open("127.0.0.1", port, page, ContentPolicy{}); + } + static void open(std::string_view address, std::string_view port, std::string_view page, const ContentPolicy& policy = {}) { + if constexpr (std::is_same_v) { + frontend::WKWebViewOptions options; + options.contentPolicy = policy; + options.visible = diagnosticWindows(); + Frontend::open(address, port, page, options); + } else if constexpr (std::is_same_v) { + frontend::WebView2Options options; + options.contentPolicy = policy; + options.visible = diagnosticWindows(); + Frontend::open(address, port, page, options); + } else { + // Linux engines use one Xvfb display around a complete suite; their native windows stay real. + Frontend::open(address, port, page, policy); + } + } +}; +} // namespace webfront::testdriver diff --git a/test/driver/WfDriver.hpp b/test/driver/WfDriver.hpp index 97b80c8f..1836b3e5 100644 --- a/test/driver/WfDriver.hpp +++ b/test/driver/WfDriver.hpp @@ -6,9 +6,11 @@ // protocol or API); 71 time limit of the driver; 72 the browser closed without a result. #pragma once -#include +#include "../unit/TemporaryDirectory.hpp" +#include "DriverSuite.hpp" +#include "TestFrontend.hpp" #include - +#include #include #include @@ -16,8 +18,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -34,9 +36,9 @@ namespace webfront::testdriver { struct DriverWebView2Options { static frontend::WebView2Options get() { #ifdef _MSC_VER - char* raw = nullptr; - std::size_t length = 0; - const auto status = _dupenv_s(&raw, &length, "WEBFRONT_TEST_WEBVIEW2_PROFILE"); + char* raw = nullptr; + std::size_t length = 0; + const auto status = _dupenv_s(&raw, &length, "WEBFRONT_TEST_WEBVIEW2_PROFILE"); const std::unique_ptr profile(raw, std::free); if (status != 0) throw std::runtime_error("Cannot read the WebView2 test profile"); @@ -47,15 +49,43 @@ struct DriverWebView2Options { } static frontend::WebView2Options get(const char* profile) { frontend::WebView2Options options; + options.visible = diagnosticWindows(); if (profile && *profile) options.userDataFolder = std::filesystem::path(profile); return options; } }; +// CEF's default profile is beside the executable, independent of the HTTP port. Each driver process/session +// uses its own profile so Chromium cannot forward an invocation into another test's browser singleton. +struct DriverCEFFrontend : frontend::CEFFrontend { + static void initialize() { + webfront::detail::ensureFrontendInitialized(); + } + static void open(std::string_view port, std::string_view page) { + open("127.0.0.1", port, page, {}); + } + static void open(std::string_view address, std::string_view port, std::string_view page, const ContentPolicy& policy = {}) { +#if defined(WEBFRONT_EMBED_CEF) && defined(__linux__) + const auto* profile = std::getenv("WEBFRONT_TEST_CEF_PROFILE"); + if (!profile || !*profile) + throw std::runtime_error("CEF test driver requires an isolated WEBFRONT_TEST_CEF_PROFILE"); + cef::detail::openWindow(frontend::detail::applicationUrl(address, port, page), + webfront::detail::BoundContentPolicy{webfront::detail::applicationOrigin(address, port), policy}, + nullptr, + std::filesystem::path(profile)); +#else + frontend::CEFFrontend::open(address, port, page, policy); +#endif + } +}; + template using DriverFrontend = std::conditional_t, - frontend::WebView2FrontendWithOptions, Frontend>; + frontend::WebView2FrontendWithOptions, + std::conditional_t, + QuietFrontend, + std::conditional_t, DriverCEFFrontend, Frontend>>>; using namespace std::chrono_literals; inline constexpr int usageStatus = 64; @@ -72,6 +102,9 @@ struct Options { std::optional report; std::chrono::seconds timeout{600}; std::vector command; + std::optional suite; + std::optional reportDirectory; + std::string filter; }; struct UsageError : std::invalid_argument { @@ -102,6 +135,12 @@ inline Options parse(int argc, char** argv) { options.registryDirectory = value(); else if (argument == "--manifest-dir") options.manifestDirectory = value(); + else if (argument == "--suite") + options.suite = value(); + else if (argument == "--report-dir") + options.reportDirectory = value(); + else if (argument == "--filter") + options.filter = value(); else if (argument == "--report") options.report = value(); else if (argument == "--timeout") { @@ -127,8 +166,12 @@ inline Options parse(int argc, char** argv) { throw UsageError("--manifest-dir expects a relative '/'-separated directory without '..'"); } } - if (options.command.empty()) + if (options.command.empty() && !options.suite) throw UsageError("A wf command is required"); + if (options.suite && (!options.command.empty() || options.report || !options.reportDirectory)) + throw UsageError("--suite requires --report-dir and replaces the command and --report"); + if (!options.suite && (options.reportDirectory || !options.filter.empty())) + throw UsageError("--report-dir and --filter require --suite"); if (options.environment.has_value() != options.integrity.has_value()) throw UsageError("--environment and --integrity go together"); #if defined(WEBFRONT_BOOTSTRAP_ARCHIVE) && defined(WEBFRONT_BOOTSTRAP_INTEGRITY) @@ -153,6 +196,36 @@ inline Sources& sources() { return instance; } +// Real HTTP page: WebFront.js derives its WebSocket URL from location.host (srcdoc has no host). +inline constexpr std::string_view suitePage = R"HTML(
)HTML"; + /// Serves the environment archive and the optional local registry under /driver/, from outside the project. class DriverFS { public: @@ -160,6 +233,15 @@ class DriverFS { std::optional open(std::filesystem::path path) const { const auto relative = path.relative_path().generic_string(); + if (relative == "driver/case.html") { + static const auto words = [] { + std::vector packed((suitePage.size() + 7) / 8); + for (std::size_t i = 0; i < suitePage.size(); ++i) + packed[i / 8] |= static_cast(static_cast(suitePage[i])) << ((7 - i % 8) * 8); + return packed; + }(); + return fs::File{std::span{words}, suitePage.size()}; + } if (relative == "driver/environment.tgz") return read(sources().archive); // The starters the environment pins sit next to its archive: plain file names only. @@ -254,12 +336,17 @@ inline constexpr auto driverScript = R"JS( const stop = () => window.close(); try { await webFront.ready; - for (;;) { - const text = document.getElementById('status')?.textContent ?? ''; - if (text.startsWith('Bootstrap failed:')) throw Object.assign(new Error(text), {bootstrap: true}); - if (text.startsWith('Developer environment ready.')) break; - await new Promise(resolve => setTimeout(resolve, 50)); - } + // Observe the bootstrap status rather than polling the DOM every 50 ms. + await new Promise((resolve, reject) => { + const observer = new MutationObserver(check); + function check() { + const text = document.getElementById('status')?.textContent ?? ''; + if (text.startsWith('Bootstrap failed:')) { observer.disconnect(); reject(new Error(text)); } + else if (text.startsWith('Developer environment ready.')) { observer.disconnect(); resolve(); } + } + observer.observe(document.documentElement, {subtree: true, childList: true, characterData: true}); + check(); + }); const config = JSON.parse(await report('webfront.developer.config')); const environment = await (await fetch('/webfront/developer/environment/environment.json')).json(); const runtime = await import(`/webfront/developer/environment/${environment.entry}`); @@ -267,10 +354,37 @@ inline constexpr auto driverScript = R"JS( throw Object.assign(new Error('Bootstrap failed: this developer environment has no non-interactive mode'), {bootstrap: true}); config.starters = Object.fromEntries(Object.entries(environment.starters ?? {}).map(([name, value]) => [name, {url: new URL(value.archive, new URL(config.environment, location.href)).href, integrity: value.integrity}])); - const argv = JSON.parse(await report('wf.arguments')); - await runtime.runNonInteractive(argv, {bridge: webFront, config, preview: document.getElementById('preview'), - signal: new AbortController().signal, write: () => {}, onExit: () => {}, - reporter: json => report('wf.result', JSON.parse(json).exitCode, json)}); + const suite = JSON.parse(await report('wf.suite')); + if (suite) { + let failed = false; + // One native browser, one fresh realm per command: imports, timers, Workers, listeners and frames + // belong to that realm. Only the explicit project and immutable HTTP resources survive between cases. + for (let index = 0; index < suite.length; ++index) { + const item = suite[index]; + await report('wf.caseStarted', index); + const frame = document.createElement('iframe'); + frame.style.cssText = 'position:fixed;left:-10000px;top:0;width:1024px;height:768px'; + const finished = new Promise((resolve, reject) => { + const receive = event => { + if (event.source !== frame.contentWindow || event.data?.driverCase !== index) return; + removeEventListener('message', receive); + event.data.error ? reject(new Error(event.data.error)) : resolve(event.data.status); + }; + addEventListener('message', receive); + }); + window.webfrontDriverCase = {index, item, config, entry: environment.entry}; + frame.src = '/driver/case.html?case=' + index; + document.body.append(frame); + try { failed = (await finished !== item.expect) || failed; } + finally { frame.remove(); delete window.webfrontDriverCase; } + } + await report('wf.result', failed ? 1 : 0, JSON.stringify({exitCode: failed ? 1 : 0, output: 'Suite completed'})); + } else { + const argv = JSON.parse(await report('wf.arguments')); + await runtime.runNonInteractive(argv, {bridge: webFront, config, preview: document.getElementById('preview'), + signal: new AbortController().signal, write: () => {}, onExit: () => {}, + reporter: json => report('wf.result', JSON.parse(json).exitCode, json)}); + } } catch (error) { await report('wf.bootstrapFailed', String(error?.message ?? error)).catch(() => {}); } finally { stop(); } @@ -284,6 +398,8 @@ class DriverBrowser { public: void connected(UI ui) { std::scoped_lock lock{mutex}; + if (browser) + return; // Commands and wf test create their own connected frames; inject only the native page. browser.emplace(std::move(ui)); browser->addScript(closing ? "window.close()" : driverScript); } @@ -296,9 +412,9 @@ class DriverBrowser { } private: - std::mutex mutex; + std::mutex mutex; std::optional browser; - bool closing = false; + bool closing = false; }; inline std::string jsonArray(const std::vector& items) { @@ -338,7 +454,7 @@ struct PlainSetup { }; template void configure(App&) {} - int finish(int status) { + int finish(int status) { return status; } }; @@ -362,8 +478,55 @@ int run(const Options& options, Setup&& setup = {}) { if (sources().registry) sources().registry = std::filesystem::canonical(*sources().registry); - Outcome outcome; - App app{options.project, {}}; + const auto cases = options.suite ? parseSuite(readSuite(*options.suite), options.filter) : std::vector{}; + if (options.reportDirectory) { + std::filesystem::create_directories(*options.reportDirectory); + for (const auto& item : cases) + std::filesystem::remove(*options.reportDirectory / (item.name + ".json")); + } + std::string suiteJson = "null"; + if (!cases.empty()) { + suiteJson = "["; + for (const auto& item : cases) + suiteJson += (suiteJson.size() > 1 ? "," : "") + std::string("{\"name\":") + json::quote(item.name) + ",\"command\":" + jsonArray(item.command) + + ",\"expect\":" + std::to_string(item.expected) + "}"; + suiteJson += "]"; + if (suiteJson.size() > 60000) + throw UsageError("Suite arguments exceed the bridge string budget (60000 bytes)"); + } + std::size_t completed = 0; + bool caseFailed = false; + const auto started = std::chrono::steady_clock::now(); + const auto phase = [&](std::string_view name) { + std::cout << "driver " << std::chrono::duration(std::chrono::steady_clock::now() - started).count() << "ms " << name << std::endl; + }; + DriverDeadline deadlines{options.timeout}; + Outcome outcome; + App app{options.project, {.port = "0"}}; + app.cppFunction("wf.suite", [suiteJson] { + return suiteJson; + }); + app.cppFunction("wf.caseStarted", [&](double index) { + if (index != static_cast(completed) || completed >= cases.size()) + throw std::runtime_error("Unexpected suite start index"); + deadlines.beginCase(cases[completed].timeout); + phase("begin " + cases[completed].name); + }); + app.cppFunction("wf.caseResult", [&](double index, double exitCode, std::string json) { + if (index != static_cast(completed) || completed >= cases.size()) + throw std::runtime_error("Unexpected suite result index"); + deadlines.endCase(); + const auto& item = cases[completed]; + printOutput(json); + Options reportOptions; + reportOptions.report = *options.reportDirectory / (item.name + ".json"); + writeReport(reportOptions, json); + if (exitCode != item.expected) + std::cerr << "suite case " << item.name << ": expected status " << item.expected << ", got " << exitCode << std::endl; + caseFailed = (exitCode != item.expected) || caseFailed; + phase("end " + item.name); + ++completed; + }); app.cppFunction("wf.arguments", [arguments = jsonArray(options.command)] { return arguments; }); @@ -378,13 +541,13 @@ int run(const Options& options, Setup&& setup = {}) { }); setup.configure(app); app.bootstrap("developer", - {.environment = "/driver/environment.tgz", - .integrity = *options.integrity, - .registry = options.registryDirectory ? std::optional{"/driver/registry/"} : std::nullopt, + {.environment = "/driver/environment.tgz", + .integrity = *options.integrity, + .registry = options.registryDirectory ? std::optional{"/driver/registry/"} : std::nullopt, .manifestDirectory = options.manifestDirectory}); DriverBrowser browser; - auto subscription = app.subscribeUIStarted([&](typename App::UI ui) { + auto subscription = app.subscribeUIStarted([&](typename App::UI ui) { browser.connected(ui); }); // The time limit: ask the page to close, then end the process if the browser does not follow. @@ -392,13 +555,7 @@ int run(const Options& options, Setup&& setup = {}) { std::mutex mutex; std::condition_variable_any wake; std::unique_lock lock{mutex}; - if (wake.wait_for(lock, - stop, - options.timeout, - [] { - return false; - }) - || stop.stop_requested()) + if (!deadlines.expired(stop)) return; outcome.timedOut(); try { @@ -417,9 +574,12 @@ int run(const Options& options, Setup&& setup = {}) { std::_Exit(timeoutStatus); } }); + phase("begin browser"); app.show(); + phase("end browser / begin shutdown"); watchdog.request_stop(); app.shutdown(); + phase("end shutdown"); int status = noResultStatus; bool hasResult = false; @@ -437,6 +597,8 @@ int run(const Options& options, Setup&& setup = {}) { std::cerr << failure << '\n'; else std::cerr << "The browser closed before the command reported a result\n"; + if (!cases.empty() && status == 0 && (caseFailed || completed != cases.size())) + status = 1; return setup.finish(status); } @@ -446,11 +608,20 @@ int main(int argc, char** argv, std::string_view program, Setup&& setup = {}) { try { // CEF child processes must dispatch before interpreting application arguments or creating files. webfront::detail::ensureFrontendInitialized(); +#if defined(WEBFRONT_EMBED_CEF) && defined(__linux__) + std::optional temporaryProfile; + if constexpr (std::is_same_v) { + if (!std::getenv("WEBFRONT_TEST_CEF_PROFILE")) { + temporaryProfile.emplace(); + ::setenv("WEBFRONT_TEST_CEF_PROFILE", temporaryProfile->path().c_str(), 1); + } + } +#endif return run(parse(argc, argv), std::forward(setup)); } catch (const UsageError& error) { - std::cerr << program << ": " << error.what() << "\nUsage: " << program - << " --project [--environment --integrity ] " - << "[--registry-dir ] [--report ] [--timeout ] [--] [arguments...]\n"; + std::cerr << program << ": " << error.what() << "\nUsage: " << program << " --project [--environment --integrity ] " + << "[--registry-dir ] [--report ] [--timeout ] [--suite --report-dir [--filter ]] [--] " + "[arguments...]\n"; return usageStatus; } catch (const std::exception& error) { std::cerr << program << ": " << error.what() << '\n'; diff --git a/test/fixtures/wf-project/tests/arithmetic.spec.js b/test/fixtures/wf-project/tests/arithmetic.spec.js index 79d6d09a..f7944f41 100644 --- a/test/fixtures/wf-project/tests/arithmetic.spec.js +++ b/test/fixtures/wf-project/tests/arithmetic.spec.js @@ -2,3 +2,17 @@ describe('arithmetic', () => { it('adds', () => { expect(1 + 1).toBe(2); }); it('fails on purpose', () => { expect(1 + 1).toBe(3); }); }); + +// Run by name in separate commands (see test/web/CMakeLists.txt): the first leaves values behind and the second must find +// none, which proves that each command starts in a fresh realm. Cleaning up here would make that check vacuous. +describe('session storage', () => { + it('writes its own storage', () => { + localStorage.setItem('wf-session-case', 'previous'); + sessionStorage.setItem('wf-session-case', 'previous'); + expect(localStorage.getItem('wf-session-case')).toBe('previous'); + }); + it('starts with clean storage', () => { + expect(localStorage.getItem('wf-session-case')).toBeNull(); + expect(sessionStorage.getItem('wf-session-case')).toBeNull(); + }); +}); diff --git a/test/fuzz/RunFuzzers.py b/test/fuzz/RunFuzzers.py new file mode 100644 index 00000000..3cdb0c46 --- /dev/null +++ b/test/fuzz/RunFuzzers.py @@ -0,0 +1,41 @@ +"""Run every decoder with bounded concurrency and independent findings/corpora.""" +import argparse +import concurrent.futures +import os +from pathlib import Path +import shutil +import subprocess + +DECODERS = ('messages', 'http', 'websocket', 'gzip', 'gzip_differential') + + +def run_all(root, jobs, seconds, run=subprocess.call): + if jobs < 1 or seconds < 1: + raise ValueError('jobs and seconds must be positive') + artifacts = root / 'artifacts' + artifacts.mkdir(parents=True, exist_ok=True) + # Differential decoding shares the seeds, never a writable corpus, with gzip. + shutil.copytree(root / 'corpus' / 'gzip', root / 'corpus' / 'gzip_differential', dirs_exist_ok=True) + + def decoder(name): + command = [str(root / ('fuzz_' + name)), str(root / 'corpus' / name), + f'-max_total_time={seconds}', '-timeout=5', '-max_len=65536', '-rss_limit_mb=1024', + f'-artifact_prefix={artifacts / name}-'] + with (artifacts / (name + '.log')).open('w') as log: + status = run(command, stdout=log, stderr=subprocess.STDOUT) + print(f'{name}: exit {status}', flush=True) + return status + + with concurrent.futures.ThreadPoolExecutor(max_workers=jobs) as pool: + results = list(pool.map(decoder, DECODERS)) + return int(any(results)) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('root', type=Path) + parser.add_argument('--jobs', type=int, default=min(2, os.cpu_count() or 1), + help='one GiB RSS budget per worker; default at most two') + parser.add_argument('--seconds', type=int, default=30) + args = parser.parse_args() + raise SystemExit(run_all(args.root.resolve(), args.jobs, args.seconds)) diff --git a/test/fuzz/TestRunFuzzers.py b/test/fuzz/TestRunFuzzers.py new file mode 100644 index 00000000..c2389c39 --- /dev/null +++ b/test/fuzz/TestRunFuzzers.py @@ -0,0 +1,38 @@ +import concurrent.futures +from pathlib import Path +import tempfile +import threading +import unittest +from RunFuzzers import DECODERS, run_all + + +class FuzzRunnerTests(unittest.TestCase): + def test_failure_does_not_skip_other_decoders_and_resources_are_isolated(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + (root / 'corpus/gzip').mkdir(parents=True) + (root / 'corpus/gzip/seed').write_bytes(b'seed') + commands = [] + lock = threading.Lock() + barrier = threading.Barrier(2) + def run(command, **kwargs): + with lock: + commands.append(command) + index = len(commands) + if index <= 2: + barrier.wait(timeout=5) + return 1 if command[0].endswith('fuzz_http') else 0 + self.assertEqual(run_all(root, 2, 30, run), 1) + self.assertEqual(len(commands), len(DECODERS)) + self.assertEqual(len({command[1] for command in commands}), len(DECODERS)) + self.assertEqual(len({command[-1] for command in commands}), len(DECODERS)) + self.assertEqual((root / 'corpus/gzip_differential/seed').read_bytes(), b'seed') + self.assertEqual(len(list((root / 'artifacts').glob('*.log'))), len(DECODERS)) + + def test_invalid_bound_is_rejected(self): + with self.assertRaises(ValueError): + run_all(Path('.'), 0, 30) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/tools/CompareCoverage.py b/test/tools/CompareCoverage.py new file mode 100644 index 00000000..3eeff2b6 --- /dev/null +++ b/test/tools/CompareCoverage.py @@ -0,0 +1,36 @@ +"""Compare per-file line, function and branch hits independently of lcov record ordering.""" +import sys +from pathlib import Path + + +def hits(path): + result = {} + source = None + for line in path.read_text(encoding='utf-8').splitlines(): + kind, _, value = line.partition(':') + if kind == 'SF': + source = value + elif kind == 'DA': + number, count, *_ = value.split(',') + key = source, kind, number + result[key] = result.get(key, 0) + int(count) + elif kind == 'FNDA': + count, name = value.split(',', 1) + key = source, kind, name + result[key] = result.get(key, 0) + int(count) + elif kind == 'BRDA': + number, block, branch, count = value.split(',') + key = source, kind, number, block, branch + previous = result.get(key, '-') + result[key] = '-' if previous == count == '-' else int(0 if previous == '-' else previous) + int(0 if count == '-' else count) + if not result: + raise ValueError('Coverage contains no counters: ' + str(path)) + return result + + +if __name__ == '__main__': + left, right = map(Path, sys.argv[1:]) + first, second = hits(left), hits(right) + if first != second: + raise SystemExit('JSON backends changed coverage counters') + print(f'Identical coverage: {len(first)} line/function/branch counters') diff --git a/test/tools/MeasureCommand.py b/test/tools/MeasureCommand.py new file mode 100644 index 00000000..84e65795 --- /dev/null +++ b/test/tools/MeasureCommand.py @@ -0,0 +1,126 @@ +"""Sample a command's process family, retaining its exit status and a JSON resource report (stdlib only).""" +import argparse +import json +import os +from pathlib import Path +import subprocess +import sys +import time + + +def ps_seconds(text): + """Parse ps's [[dd-]hh:]mm:ss[.ss] cumulative CPU time.""" + days, _, clock = text.rpartition('-') + seconds = 0.0 + for part in clock.split(':'): + seconds = seconds * 60 + float(part) + return seconds + float(days or 0) * 86400 + + +def snapshot(root=None): + """pid -> (parent, resident bytes, cumulative CPU seconds). Sampling can miss short-lived children.""" + result = {} + if sys.platform.startswith('linux'): + ticks = os.sysconf('SC_CLK_TCK') + page = os.sysconf('SC_PAGE_SIZE') + for directory in Path('/proc').glob('[0-9]*'): + try: + stat = (directory / 'stat').read_text().rsplit(')', 1)[1].split() + result[int(directory.name)] = (int(stat[1]), int(stat[21]) * page, + (int(stat[11]) + int(stat[12])) / ticks) + except (OSError, ValueError, IndexError): + pass + elif sys.platform == 'darwin': + output = subprocess.check_output(['ps', '-axo', 'pid=,ppid=,rss=,time='], text=True) + for line in output.splitlines(): + pid, parent, rss, cpu = line.split() + seconds = ps_seconds(cpu) + result[int(pid)] = (int(parent), int(rss) * 1024, seconds) + elif sys.platform == 'win32': + import ctypes as c + from ctypes import wintypes as w + class Entry(c.Structure): + _fields_ = [('size', w.DWORD), ('usage', w.DWORD), ('pid', w.DWORD), ('heap', c.c_size_t), + ('module', w.DWORD), ('threads', w.DWORD), ('parent', w.DWORD), + ('priority', w.LONG), ('flags', w.DWORD), ('name', w.WCHAR * 260)] + class Memory(c.Structure): + _fields_ = [('size', w.DWORD), ('faults', w.DWORD)] + [(name, c.c_size_t) for name in + ('peakWorking', 'working', 'peakPaged', 'paged', 'peakNonpaged', 'nonpaged', 'pagefile', 'peakPagefile')] + kernel = c.WinDLL('kernel32', use_last_error=True) + kernel.CreateToolhelp32Snapshot.restype = w.HANDLE + kernel.OpenProcess.restype = w.HANDLE + kernel.CloseHandle.argtypes = [w.HANDLE] + kernel.Process32FirstW.argtypes = [w.HANDLE, c.POINTER(Entry)] + kernel.Process32NextW.argtypes = [w.HANDLE, c.POINTER(Entry)] + kernel.GetProcessTimes.argtypes = [w.HANDLE] + [c.POINTER(w.FILETIME)] * 4 + psapi = c.WinDLL('psapi') + psapi.GetProcessMemoryInfo.argtypes = [w.HANDLE, c.POINTER(Memory), w.DWORD] + handle = kernel.CreateToolhelp32Snapshot(2, 0) + entry = Entry(size=c.sizeof(Entry)) + parents = {} + more = kernel.Process32FirstW(handle, c.byref(entry)) + while more: + parents[entry.pid] = entry.parent + more = kernel.Process32NextW(handle, c.byref(entry)) + # Opening every process on a loaded runner can outlast a short command: only query the root's descendants. + wanted = set(parents) + if root is not None: + wanted = {root} + while True: + children = {pid for pid, parent in parents.items() if parent in wanted} + if children <= wanted: + break + wanted |= children + for pid in wanted & set(parents): + process = kernel.OpenProcess(0x1000 | 0x10, False, pid) + if process: + memory = Memory(size=c.sizeof(Memory)) + times = [w.FILETIME() for _ in range(4)] + if psapi.GetProcessMemoryInfo(process, c.byref(memory), memory.size) and kernel.GetProcessTimes(process, *map(c.byref, times)): + cpu = sum((item.dwHighDateTime << 32) + item.dwLowDateTime for item in times[2:]) / 10_000_000 + result[pid] = (parents[pid], memory.working, cpu) + kernel.CloseHandle(process) + kernel.CloseHandle(handle) + else: + raise RuntimeError('Unsupported resource sampler platform: ' + sys.platform) + return result + + +def measure(command, output, interval=0.25): + started = time.monotonic() + process = subprocess.Popen(command) + observed = {} + peak_memory = peak_count = 0 + while process.poll() is None: + processes = snapshot(process.pid) + family = {process.pid} + while True: + children = {pid for pid, (parent, _, _) in processes.items() if parent in family} + if children <= family: + break + family.update(children) + active = {pid: processes[pid] for pid in family if pid in processes} + peak_memory = max(peak_memory, sum(item[1] for item in active.values())) + peak_count = max(peak_count, len(active)) + for pid, (_, _, cpu) in active.items(): + observed[pid] = max(cpu, observed.get(pid, 0)) + time.sleep(interval) + result = {'command': command, 'platform': sys.platform, 'exit_code': process.returncode, + 'wall_seconds': time.monotonic() - started, 'sample_interval_seconds': interval, + 'sampled_peak_family_rss_bytes': peak_memory, 'sampled_peak_processes': peak_count, + 'sampled_processes_seen': len(observed), 'sampled_cpu_seconds': sum(observed.values()), + 'limitation': 'Sampled bounds: short-lived children may be missed; shared pages count in each process RSS.'} + output.parent.mkdir(parents=True, exist_ok=True) + output.write_text(json.dumps(result, indent=2) + '\n', encoding='utf-8') + return process.returncode + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--output', type=Path, required=True) + parser.add_argument('command', nargs=argparse.REMAINDER) + args = parser.parse_args() + command = args.command[1:] if args.command[:1] == ['--'] else args.command + if not command: + parser.error('a command is required') + raise SystemExit(measure(command, args.output)) diff --git a/test/tools/ProfileTests.py b/test/tools/ProfileTests.py new file mode 100644 index 00000000..51d25841 --- /dev/null +++ b/test/tools/ProfileTests.py @@ -0,0 +1,133 @@ +"""Combine CTest's JSON dependency/lock graph and JUnit timings without summing parallel wall times.""" +import argparse +import json +from pathlib import Path +import statistics +import re +import xml.etree.ElementTree as ET + + +def analyze(graph, report, workers): + tests = {test['name']: {p['name']: p['value'] for p in test.get('properties', [])} + for test in graph['tests']} + xml = ET.parse(report).getroot() + times = {case.attrib['name']: float(case.attrib.get('time', 0)) for case in xml.iter('testcase')} + setters = {} + for name, properties in tests.items(): + for fixture in properties.get('FIXTURES_SETUP', []): + setters.setdefault(fixture, []).append(name) + edges = {name: set(properties.get('DEPENDS', [])) for name, properties in tests.items()} + locks = {} + for name, properties in tests.items(): + for fixture in properties.get('FIXTURES_REQUIRED', []): + edges[name].update(setters.get(fixture, [])) + for lock in properties.get('RESOURCE_LOCK', []): + locks.setdefault(lock, []).append(name) + # A fixture cleanup waits for every setup and consumer, even when there are no explicit DEPENDS edges. + for name, properties in tests.items(): + for fixture in properties.get('FIXTURES_CLEANUP', []): + edges[name].update(setters.get(fixture, [])) + edges[name].update(consumer for consumer, props in tests.items() + if fixture in props.get('FIXTURES_REQUIRED', [])) + costs = {} + visiting = set() + def cost(name): + if name in visiting: + raise ValueError('Cyclic CTest dependency: ' + name) + if name not in costs: + visiting.add(name) + costs[name] = times.get(name, 0) + max((cost(parent) for parent in edges.get(name, [])), default=0) + visiting.remove(name) + return costs[name] + critical = max((cost(name) for name in times), default=0) + serial = sum(times.get(name, 0) for name, props in tests.items() if props.get('RUN_SERIAL')) + lock_cost = max((sum(times.get(name, 0) for name in names) for names in locks.values()), default=0) + # Lower bounds only: lock scheduling and fixture order can make the actual critical path longer. + return {'wall_seconds': float(xml.attrib.get('time', 0)), 'sum_seconds': sum(times.values()), + 'dependency_path_seconds': critical, 'serial_seconds': serial, + 'lower_bound_seconds': max(critical, sum(times.values()) / workers, lock_cost, serial), + 'cases': len(times), 'slowest': sorted(times.items(), key=lambda x: x[1], reverse=True)[:25], + 'edges': edges, 'locks': locks} + + +def compile_profile(path): + records = [] + for line in path.read_text(encoding='utf-8', errors='replace').splitlines(): + if line.startswith('#'): + continue + columns = line.split('\t') + if len(columns) != 5: + continue + start, end, _, output, _ = columns + seconds = (int(end) - int(start)) / 1000 + if seconds < 0: + raise ValueError('Negative Ninja job duration: ' + output) + records.append((seconds, output)) + return sorted(records, reverse=True) + + +def write_report(result, output): + output.parent.mkdir(parents=True, exist_ok=True) + lines = ['CTest profile', '', f"Cases: {result['cases']}"] + for key in ('wall_seconds', 'sum_seconds', 'dependency_path_seconds', 'serial_seconds', 'lower_bound_seconds'): + lines.append(f'{key}: {result[key]:.3f}') + lines += ['', 'Slowest cases (seconds):'] + [f'{seconds:9.3f} {name}' for name, seconds in result['slowest']] + output.write_text('\n'.join(lines) + '\n', encoding='utf-8') + dot = ['digraph ctest {'] + for name, dependencies in result['edges'].items(): + dot.append(' ' + json.dumps(name) + ';') + for dependency in dependencies: + dot.append(f' {json.dumps(dependency)} -> {json.dumps(name)};') + for lock, names in result['locks'].items(): + for name in names: + dot.append(f' {json.dumps("lock: " + lock)} -> {json.dumps(name)} [style=dashed];') + output.with_suffix('.dot').write_text('\n'.join(dot + ['}']) + '\n', encoding='utf-8') + + +PHASE = re.compile(r'(?:wf spec: |Developer integration: )?(?:[\d.]+ms )?end (.*?)(?: status=\S+)? durationMs=([\d.]+)') + + +def phase_durations(transcripts): + """(duration ms, 'pass N: name') for every `