Skip to content

Commit 5537637

Browse files
copyleftdevclaude
andcommitted
fix(test): use unique user-data-dir per browser to prevent SingletonLock
Each stealth test now creates a temp dir for Chrome's user data, preventing profile lock conflicts when tests run in parallel. Rebrowser Bot Detector results (live test): - 9/10 PASS, 1 known flag (navigatorWebdriver=undefined flagged as "manually deleted" — expected tradeoff vs setting to false) - Runtime.enable leak: NOT DETECTED - Source URL leak: NOT DETECTED - Viewport: PASS (1920x1080, not automation defaults) - CSP bypass: NOT DETECTED - Playwright init scripts: NOT DETECTED Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f14b069 commit 5537637

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/palimpsest-fetch/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ palimpsest-storage = { path = "../palimpsest-storage" }
3535
palimpsest-replay = { path = "../palimpsest-replay" }
3636
futures = "0.3"
3737
serde_json = { workspace = true }
38+
tempfile = { workspace = true }
3839
tokio = { workspace = true, features = ["rt", "macros"] }
3940
wiremock = { workspace = true }

crates/palimpsest-fetch/tests/stealth_test.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@ use futures::StreamExt;
2626
use palimpsest_core::types::CrawlSeed;
2727

2828
/// Build a stealth-hardened browser matching Palimpsest's stealth mode.
29+
/// Each instance uses a unique user-data-dir to prevent SingletonLock conflicts.
2930
async fn launch_stealth_browser(
30-
seed: CrawlSeed,
31+
_seed: CrawlSeed,
3132
) -> Result<(Browser, tokio::task::JoinHandle<()>), Box<dyn std::error::Error>> {
33+
let data_dir = tempfile::tempdir().map_err(|e| format!("tempdir: {e}"))?;
3234
let config = BrowserConfig::builder()
3335
.no_sandbox()
3436
.arg("--headless=new")
3537
.arg("--disable-gpu")
3638
.arg("--disable-dev-shm-usage")
39+
.arg(format!("--user-data-dir={}", data_dir.path().display()))
3740
.arg("--disable-background-networking")
3841
.arg("--disable-default-apps")
3942
.arg("--disable-extensions")

0 commit comments

Comments
 (0)