Skip to content

Commit

Permalink
ci: install newer clang
Browse files Browse the repository at this point in the history
  • Loading branch information
mmat11 committed May 27, 2024
1 parent 9f07d53 commit b7bc3f3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
uses: actions/[email protected]
with:
go-version: 1.22.3
- name: Install newer Clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh 14
- name: Install dependencies
run: |
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion testdata/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CLANG ?= clang-17
CLANG ?= clang-14
CFLAGS := -O2 -Wall -Werror

all: clean simple semaphore lint
Expand Down
16 changes: 8 additions & 8 deletions usdt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import (
"github.com/mmat11/usdt"
)

const (
probeInitTime = 100 * time.Millisecond
probeFireTime = 10 * time.Millisecond
)

func TestUSDT(t *testing.T) {
if err := rlimit.RemoveMemlock(); err != nil {
t.Fatal(err)
Expand All @@ -22,7 +27,6 @@ func TestUSDT(t *testing.T) {
cmd *exec.Cmd
provider string
probe string
sleep time.Duration
}{
{
"Python (builtin notes)",
Expand All @@ -33,28 +37,24 @@ func TestUSDT(t *testing.T) {
),
"python",
"function__entry",
100 * time.Millisecond,
},
{
"Python (libstapsdt)",
exec.Command("python", "testdata/libstapsdt.py"),
"X",
"Y",
100 * time.Millisecond,
},
{
"C (simple)",
exec.Command("testdata/simple.o"),
"X",
"Y",
0,
},
{
"C (semaphore)",
exec.Command("testdata/semaphore.o"),
"X",
"Y",
0,
},
}

Expand All @@ -75,7 +75,7 @@ func TestUSDT(t *testing.T) {
}()

// Give some time for the process to start/setup the probes.
time.Sleep(tt.sleep)
time.Sleep(probeInitTime)

// Open and attach the USDT probe.
u, err := usdt.New(p, tt.provider, tt.probe, tt.cmd.Process.Pid)
Expand All @@ -84,7 +84,7 @@ func TestUSDT(t *testing.T) {
}

// Wait for the probe to fire.
time.Sleep(5 * time.Millisecond)
time.Sleep(probeFireTime)

// Assert that the value at index 0 has been updated to 1.
assertMapValue(t, m, 0, 1)
Expand All @@ -99,7 +99,7 @@ func TestUSDT(t *testing.T) {
}

// Wait for the probe to eventually fire.
time.Sleep(5 * time.Millisecond)
time.Sleep(probeFireTime)

// Assert that this time the value has not been updated.
assertMapValue(t, m, 0, 0)
Expand Down

0 comments on commit b7bc3f3

Please sign in to comment.