Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: install newer clang #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 17
- name: Install dependencies
run: |
sudo apt-get update
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
Loading