Merge pull request #2406 from PR0M3TH3AN/ai/weekly-bug-reproducer-hashtag-flakiness-11321273883304913915

Weekly Agent: Bug Reproducer (Hashtag Preferences Flakiness)
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-02-12 16:14:18 -05:00
commit c29d425c0d
3 files changed
+68

No files matched your search

+1
View File
@@ -1 +1,2 @@
date,agent_name,prompt_file,status,branch,summary
2026-02-12,bug-reproducer-agent,bitvid-bug-reproducer-agent.md,completed,unstable,"Created reproducer for hashtag preferences flakiness (tests/hashtag-preferences.test.mjs)"
1 date agent_name prompt_file status branch summary
2 2026-02-12 bug-reproducer-agent bitvid-bug-reproducer-agent.md completed unstable Created reproducer for hashtag preferences flakiness (tests/hashtag-preferences.test.mjs)
@@ -0,0 +1,20 @@
# Hashtag Preferences Flakiness Reproducer
This reproducer attempts to demonstrate flakiness in the unit test `tests/hashtag-preferences.test.mjs`, specifically the test case `"load defers permission-required decrypts until explicitly enabled"`.
This test was reported as flaky in CI due to timing issues with `runNip07WithRetry` and microtasks when simulating explicit permission retries.
## Usage
Run the reproducer script:
```bash
node examples/reproducers/hashtag-flakiness/repro.mjs
```
This script will run the unit test file 20 times in a loop. If it fails on any iteration, it will exit with an error code and print the iteration number.
## Expected Behavior
If the issue is reproducible, the script should fail within the 20 iterations.
If the issue is not reproducible (e.g. fixed, or requires specific CI conditions), the script will complete all 20 iterations successfully.
@@ -0,0 +1,47 @@
import { spawn } from 'node:child_process';
const MAX_RUNS = 20;
async function runTest(iteration) {
return new Promise((resolve, reject) => {
const child = spawn('npm', ['run', 'test:unit', '--', 'tests/hashtag-preferences.test.mjs'], {
stdio: 'inherit',
shell: true,
env: { ...process.env, FORCE_COLOR: '1' }
});
child.on('close', (code) => {
if (code === 0) {
resolve();
} else {
reject(new Error(`Test failed on iteration ${iteration} with exit code ${code}`));
}
});
child.on('error', (err) => {
reject(err);
});
});
}
async function main() {
console.log(`Starting reproduction loop (${MAX_RUNS} runs)...`);
for (let i = 1; i <= MAX_RUNS; i++) {
console.log(`\n--- Iteration ${i}/${MAX_RUNS} ---`);
try {
await runTest(i);
} catch (error) {
console.error(`\n❌ REPRODUCTION SUCCESSFUL: ${error.message}`);
process.exit(1);
}
}
console.log(`\n✅ Passed ${MAX_RUNS} iterations without failure.`);
// If we reach here, we failed to reproduce the issue (or it's not flaky enough).
// We exit with 0 to indicate the script ran successfully, even if reproduction failed.
// But strictly speaking, if the goal is to reproduce, maybe we should warn.
process.exit(0);
}
main();