mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
chore(agents): run bug-reproducer-agent weekly task — Created reproducer for hashtag preferences flakiness
Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
8b00db23e3
commit
20a295b170
3 files changed
+68
No files matched your search
@@ -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)"
|
||||
|
@@ -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();
|
||||
Reference in new issue
Block a user