Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Kemal Akkoyun <[email protected]>
  • Loading branch information
kakkoyun committed Feb 23, 2024
1 parent 7cda6ec commit 8fffcdf
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/python/initialstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type InitialState struct {
InterpreterHead int64 `yaml:"interpreter_head"`
ThreadStateCurrent int64 `yaml:"tstate_current"`
AutoTSSKey int64 `yaml:"auto_tss_key"`
PyTSSKey PyTSSKey `yaml:"tss"`
PyTSS PyTSSKey `yaml:"tss"`
}

type PyTSSKey struct {
Expand Down Expand Up @@ -91,7 +91,7 @@ func (i initialState312) InitialState() runtimedata.RuntimeData {
AutoTSSKey: i.AutoTSSKey,
// https://github.com/python/cpython/issues/103323
ThreadStateCurrent: doesNotExist,
PyTSSKey: PyTSSKey{
PyTSS: PyTSSKey{
Key: i.PyTSSKey,
Size: i.PyTSSSize,
},
Expand All @@ -114,7 +114,7 @@ func (i initialState38) InitialState() runtimedata.RuntimeData {
InterpreterHead: i.InterpreterHead,
ThreadStateCurrent: i.ThreadStateCurrent,
AutoTSSKey: i.AutoTSSKey,
PyTSSKey: PyTSSKey{
PyTSS: PyTSSKey{
Key: i.PyTSSKey,
Size: i.PyTSSSize,
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
74 changes: 72 additions & 2 deletions pkg/python/python_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,48 +204,83 @@ func TestGetInitialState(t *testing.T) {
want: &InitialState{
InterpreterHead: 24,
ThreadStateCurrent: 1392,
AutoTSSKey: 1416,
PyTSS: PyTSSKey{
Key: 4,
Size: 8,
},
},
},
{
version: "3.7.4",
want: &InitialState{
InterpreterHead: 24,
ThreadStateCurrent: 1480,
AutoTSSKey: 1504,
PyTSS: PyTSSKey{
Key: 4,
Size: 8,
},
},
},
{
version: "3.8.0",
want: &InitialState{
InterpreterHead: 32,
ThreadStateCurrent: 1368,
AutoTSSKey: 1392,
PyTSS: PyTSSKey{
Key: 4,
Size: 8,
},
},
},
{
version: "3.9.6",
want: &InitialState{
InterpreterHead: 32,
ThreadStateCurrent: 568,
AutoTSSKey: 584,
PyTSS: PyTSSKey{
Key: 4,
Size: 8,
},
},
},
{
version: "3.10.0",
want: &InitialState{
InterpreterHead: 32,
ThreadStateCurrent: 568,
AutoTSSKey: 584,
PyTSS: PyTSSKey{
Key: 4,
Size: 8,
},
},
},
{
version: "3.11.0",
want: &InitialState{
InterpreterHead: 40,
ThreadStateCurrent: 576,
AutoTSSKey: 592,
PyTSS: PyTSSKey{
Key: 4,
Size: 8,
},
},
},
{
version: "3.12.0",
want: &InitialState{
InterpreterHead: 40,
ThreadStateCurrent: 576,
ThreadStateCurrent: -1,
AutoTSSKey: 1544,
PyTSS: PyTSSKey{
Key: 4,
Size: 8,
},
},
},
// arm64
Expand Down Expand Up @@ -273,6 +308,11 @@ func TestGetInitialState(t *testing.T) {
want: &InitialState{
InterpreterHead: 24,
ThreadStateCurrent: 1408,
AutoTSSKey: 1432,
PyTSS: PyTSSKey{
Key: 4,
Size: 8,
},
},
},
{
Expand All @@ -281,6 +321,11 @@ func TestGetInitialState(t *testing.T) {
want: &InitialState{
InterpreterHead: 24,
ThreadStateCurrent: 1496,
AutoTSSKey: 1520,
PyTSS: PyTSSKey{
Key: 4,
Size: 8,
},
},
},
{
Expand All @@ -289,6 +334,11 @@ func TestGetInitialState(t *testing.T) {
want: &InitialState{
InterpreterHead: 32,
ThreadStateCurrent: 1384,
AutoTSSKey: 1408,
PyTSS: PyTSSKey{
Key: 4,
Size: 8,
},
},
},
{
Expand All @@ -297,6 +347,11 @@ func TestGetInitialState(t *testing.T) {
want: &InitialState{
InterpreterHead: 32,
ThreadStateCurrent: 584,
AutoTSSKey: 600,
PyTSS: PyTSSKey{
Key: 4,
Size: 8,
},
},
},
{
Expand All @@ -305,6 +360,11 @@ func TestGetInitialState(t *testing.T) {
want: &InitialState{
InterpreterHead: 32,
ThreadStateCurrent: 584,
AutoTSSKey: 600,
PyTSS: PyTSSKey{
Key: 4,
Size: 8,
},
},
},
{
Expand All @@ -313,14 +373,24 @@ func TestGetInitialState(t *testing.T) {
want: &InitialState{
InterpreterHead: 40,
ThreadStateCurrent: 592,
AutoTSSKey: 608,
PyTSS: PyTSSKey{
Key: 4,
Size: 8,
},
},
},
{
version: "3.12.0",
arch: "arm64",
want: &InitialState{
InterpreterHead: 40,
ThreadStateCurrent: 592,
ThreadStateCurrent: -1,
AutoTSSKey: 1544,
PyTSS: PyTSSKey{
Key: 4,
Size: 8,
},
},
},
}
Expand Down
1 change: 1 addition & 0 deletions scripts/download/python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ python_versions=(
3.9.6 # security
3.10.0 # security
3.11.0 # bugfix
3.12.0
3.12.2
3.13.0a4
)
Expand Down

0 comments on commit 8fffcdf

Please sign in to comment.