Run intensive stress test with our optimal configuration
()
| 150 | |
| 151 | |
| 152 | def run_stress_test(): |
| 153 | """Run intensive stress test with our optimal configuration""" |
| 154 | print(f"\n🔥 STRESS TEST: Optimal Configuration") |
| 155 | print("=" * 70) |
| 156 | |
| 157 | # Use our optimal capacity with large dataset |
| 158 | capacity = 256 |
| 159 | prepopulate = 50000 |
| 160 | operations = 500000 # Half million operations |
| 161 | |
| 162 | print( |
| 163 | f"Configuration: Capacity={capacity}, Prepopulate={prepopulate:,}, Operations={operations:,}" |
| 164 | ) |
| 165 | |
| 166 | seed = random.randint(1, 1000000) |
| 167 | tester = BPlusTreeFuzzTester(capacity=capacity, seed=seed, prepopulate=prepopulate) |
| 168 | |
| 169 | start_time = time.time() |
| 170 | success = tester.run_fuzz_test(operations) |
| 171 | elapsed = time.time() - start_time |
| 172 | |
| 173 | if success: |
| 174 | print(f"✅ STRESS TEST PASSED!") |
| 175 | print(f" Time: {elapsed:.1f}s") |
| 176 | print(f" Rate: {operations/elapsed:.0f} ops/sec") |
| 177 | print(f" Final size: {len(tester.btree):,} keys") |
| 178 | else: |
| 179 | print(f"❌ STRESS TEST FAILED") |
| 180 | print(f" Seed: {seed}") |
| 181 | |
| 182 | return success |
| 183 | |
| 184 | |
| 185 | def run_edge_case_tests(): |
no test coverage detected