From f148f11cf8a0333d1e79e1a96b081797ef015a27 Mon Sep 17 00:00:00 2001 From: Diego Veralli Date: Sat, 27 Apr 2024 01:56:25 +0200 Subject: [PATCH 1/2] Only add tab if title and window_id are present, as a workaround for tabs with null attributes. Workaround for #11. --- host/src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/host/src/main.rs b/host/src/main.rs index fd9de2a..c190b06 100644 --- a/host/src/main.rs +++ b/host/src/main.rs @@ -302,7 +302,13 @@ fn main() -> io::Result<()> { attributes.merge(&existing.1); *existing = (curr_time, attributes); } else { - data.insert(event.tab_info.tab_id, (curr_time, attributes)); + // We some times receive events with null titles and window ids, for which + // we never receive remove events afterwards. Not sure what those are, + // they might be the result of a race condition on the extension side, but + // as a workaround we ignore them here. + if attributes.title.is_some() && attributes.window_id.is_some() { + data.insert(event.tab_info.tab_id, (curr_time, attributes)); + } } } } From 48470f955dcac577c76896e5daba5bc08d02699c Mon Sep 17 00:00:00 2001 From: Diego Veralli Date: Sun, 2 Jun 2024 14:46:09 +0200 Subject: [PATCH 2/2] Ensure results file is written when invocation returns error code --- integration_tests/run_tests.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/integration_tests/run_tests.sh b/integration_tests/run_tests.sh index ec2a5f1..02fd76e 100755 --- a/integration_tests/run_tests.sh +++ b/integration_tests/run_tests.sh @@ -102,23 +102,33 @@ function run-suite() { local invocation=( dbus-launch "$VIRTUALENV_DIR"/bin/python3 tabreport_tests.py "$ff_version" "$xpi_file" ) tmpfile= if [ "$REPORT_MD_FILE" != "" ]; then + echo "Outputting to ${REPORT_MD_FILE}" >&2 tmpfile="$(mktemp)" invocation=( "${invocation[@]}" -o "$tmpfile" ) fi + result=0 if [ "$host_target_version" != "" ]; then echo "Running integration tests with Firefox $ff_version and native host version ${host_target_version}" >&2 echo "" >&2 + set +e HOST_TARGET_VERSION="$host_target_version" "${invocation[@]}" + result=$? + set -e else echo "Running integration tests with Firefox $ff_version" >&2 echo "" >&2 + set +e "${invocation[@]}" + result=$? + set -e fi if [ "$REPORT_MD_FILE" != "" ]; then cat "$tmpfile" >> "$REPORT_MD_FILE" fi + + return "$result" } while read -r ff_version; do