forked from sourcegit-scm/sourcegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstress_test.sh
More file actions
executable file
·55 lines (47 loc) · 1.21 KB
/
stress_test.sh
File metadata and controls
executable file
·55 lines (47 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# Stress test for SourceGit lock handling
echo "=== SourceGit Stress Test ==="
echo "Open SourceGit with this repository first!"
echo "Press Enter when ready..."
read
REPO_PATH=$(pwd)
echo "Starting stress test..."
# Test 1: Rapid lock creation/removal
echo "Test 1: Rapid lock file creation..."
for i in {1..20}; do
touch .git/index.lock
sleep 0.1
rm -f .git/index.lock
sleep 0.1
echo -n "."
done
echo " Done!"
# Test 2: Concurrent branch operations
echo "Test 2: Concurrent branch creation..."
for i in {1..10}; do
git branch "stress-test-$i" &
done
wait
echo "Created 10 branches concurrently"
# Test 3: Rapid branch switching
echo "Test 3: Rapid branch switching..."
for i in {1..10}; do
git checkout -q "stress-test-$i" 2>/dev/null
echo -n "."
done
git checkout -q master 2>/dev/null
echo " Done!"
# Test 4: Lock during operations
echo "Test 4: Creating lock during refresh..."
touch .git/index.lock
echo "Lock created - try refreshing in SourceGit now"
sleep 3
rm .git/index.lock
echo "Lock removed"
echo ""
echo "=== Stress Test Complete ==="
echo "Check SourceGit for:"
echo "- No crashes"
echo "- All branches visible"
echo "- Memory usage stable"
echo "- UI still responsive"