Download tasks/format-code-task-000062/tests/test.patch from FineEnvs/MiMo-V2.6-RL-harbor-code: direct link, hf CLI and curl.
- Browser
- Download file 2.38 kB
-
https://huggingface.co/datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/resolve/main/tasks/format-code-task-000062/tests/test.patch
- Command line
-
hf download hf://datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/tasks/format-code-task-000062/tests/test.patch
-
curl -L -o test.patch https://huggingface.co/datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/resolve/main/tasks/format-code-task-000062/tests/test.patch
2.38 kB
| diff --git a/profiler/options_test.go b/profiler/options_test.go | |
| index 0cc04d69e..053c13ca1 100644 | |
| --- a/profiler/options_test.go | |
| +++ b/profiler/options_test.go | |
| func TestOptions(t *testing.T) { | |
| assert.Equal(t, 3*time.Second, cfg.cpuDuration) | |
| }) | |
| + t.Run("CPUProfileRate", func(t *testing.T) { | |
| + var cfg config | |
| + CPUProfileRate(123)(&cfg) | |
| + assert.Equal(t, 123, cfg.cpuProfileRate) | |
| + }) | |
| + | |
| + t.Run("CPUProfileRate/default", func(t *testing.T) { | |
| + cfg, err := defaultConfig() | |
| + require.NoError(t, err) | |
| + assert.Equal(t, 0, cfg.cpuProfileRate) | |
| + }) | |
| + | |
| t.Run("MutexProfileFraction", func(t *testing.T) { | |
| var cfg config | |
| MutexProfileFraction(1)(&cfg) | |
| diff --git a/profiler/profile_test.go b/profiler/profile_test.go | |
| index 7c14422c9..ead96f9dc 100644 | |
| --- a/profiler/profile_test.go | |
| +++ b/profiler/profile_test.go | |
| import ( | |
| "io" | |
| "io/ioutil" | |
| "os" | |
| + "runtime" | |
| "strconv" | |
| "strings" | |
| "testing" | |
| main;bar 0 0 8 16 | |
| assert.Equal(t, []byte("my-cpu-profile"), profs[0].data) | |
| }) | |
| + t.Run("cpu-profile-rate", func(t *testing.T) { | |
| + | |
| + | |
| + | |
| + | |
| + defer runtime.SetCPUProfileRate(0) | |
| + rate := 500 | |
| + p, err := unstartedProfiler( | |
| + CPUProfileRate(rate), | |
| + CPUDuration(20*time.Millisecond), | |
| + ) | |
| + require.NoError(t, err) | |
| + profs, err := p.runProfile(CPUProfile) | |
| + require.NoError(t, err) | |
| + require.Equal(t, "cpu.pprof", profs[0].name) | |
| + prof, err := pprofile.ParseData(profs[0].data) | |
| + require.NoError(t, err) | |
| + assert.Equal(t, int64(1e9/rate), prof.Period, | |
| + "CPU profile period should reflect the configured CPUProfileRate") | |
| + }) | |
| + | |
| t.Run("goroutine", func(t *testing.T) { | |
| defer func(old func(_ string, _ io.Writer, _ int) error) { lookupProfile = old }(lookupProfile) | |
| lookupProfile = func(name string, w io.Writer, _ int) error { | |
| diff --git a/test_commands.json b/test_commands.json | |
| new file mode 100644 | |
| index 000000000..ca7b84652 | |
| --- /dev/null | |
| +++ b/test_commands.json | |
| +{ | |
| + "test_commands": ["go test ./profiler/ -run \"TestRunProfile/cpu|TestOptions/CPUProfileRate\" -v"] | |
| +} | |
| diff --git a/mimo_test_command.sh b/mimo_test_command.sh | |
| new file mode 100755 | |
| --- /dev/null | |
| +++ b/mimo_test_command.sh | |
| +#!/usr/bin/env bash | |
| + | |
| +set -uo pipefail | |
| +cd /testbed | |
| +rc=0 | |
| +go test ./profiler/ -run "TestRunProfile/cpu|TestOptions/CPUProfileRate" -v | |
| +rc=$(( rc | $? )) | |
| +exit $rc | |