make olin tests pass for now
This commit is contained in:
parent
45fcf5fb84
commit
6b1a8165df
|
@ -155,7 +155,7 @@ func waitForNewWASM(ctx context.Context, wg *sync.WaitGroup, sh *shell.Shell, nc
|
||||||
Name: "stderr.txt",
|
Name: "stderr.txt",
|
||||||
Data: stderr.Bytes(),
|
Data: stderr.Bytes(),
|
||||||
},
|
},
|
||||||
result.ToFile(),
|
result.StatsFile(),
|
||||||
{
|
{
|
||||||
Name: "wasm.cid",
|
Name: "wasm.cid",
|
||||||
Data: []byte(er.WASMCID),
|
Data: []byte(er.WASMCID),
|
||||||
|
|
|
@ -20,7 +20,8 @@ func runHandler(ctx context.Context, hdlr Handler, timeout time.Duration, messag
|
||||||
Name: hdlr.Name,
|
Name: hdlr.Name,
|
||||||
Data: message,
|
Data: message,
|
||||||
Env: map[string]string{
|
Env: map[string]string{
|
||||||
"RUN_ID": execID,
|
"RUN_ID": execID,
|
||||||
|
"MAGIC_CONCH": "yes",
|
||||||
},
|
},
|
||||||
UUID: execID,
|
UUID: execID,
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,15 +32,16 @@ type Config struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Result struct {
|
type Result struct {
|
||||||
Status int64
|
Status int64
|
||||||
GasUsed uint64
|
GasUsed uint64
|
||||||
SyscallCount int64
|
SyscallCount int64
|
||||||
ExecDur time.Duration
|
ExecDur time.Duration
|
||||||
PagesUsed int
|
PagesBeforeExec int
|
||||||
StartTime time.Time
|
PagesUsed int
|
||||||
|
StartTime time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r Result) ToFile() txtar.File {
|
func (r Result) StatsFile() txtar.File {
|
||||||
table := uitable.New()
|
table := uitable.New()
|
||||||
|
|
||||||
table.AddRow("Status", fmt.Sprint(r.Status))
|
table.AddRow("Status", fmt.Sprint(r.Status))
|
||||||
|
@ -48,6 +49,7 @@ func (r Result) ToFile() txtar.File {
|
||||||
table.AddRow("Syscall Count", fmt.Sprint(r.SyscallCount))
|
table.AddRow("Syscall Count", fmt.Sprint(r.SyscallCount))
|
||||||
table.AddRow("Exec Duration", r.ExecDur.String())
|
table.AddRow("Exec Duration", r.ExecDur.String())
|
||||||
table.AddRow("Pages Used", fmt.Sprint(r.PagesUsed))
|
table.AddRow("Pages Used", fmt.Sprint(r.PagesUsed))
|
||||||
|
table.AddRow("Page Delta", fmt.Sprint(r.PagesUsed-r.PagesBeforeExec))
|
||||||
|
|
||||||
return txtar.File{
|
return txtar.File{
|
||||||
Name: "vmstats.txt",
|
Name: "vmstats.txt",
|
||||||
|
@ -73,6 +75,7 @@ func Run(c Config) (*Result, error) {
|
||||||
return nil, ErrNoCWAMain
|
return nil, ErrNoCWAMain
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pagesBefore := len(vm.Memory) / 65536
|
||||||
begin := time.Now()
|
begin := time.Now()
|
||||||
ret, err := vm.Run(main)
|
ret, err := vm.Run(main)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -83,11 +86,12 @@ func Run(c Config) (*Result, error) {
|
||||||
p.Logger.Printf("[SYSTEM] return status: %v", ret)
|
p.Logger.Printf("[SYSTEM] return status: %v", ret)
|
||||||
|
|
||||||
return &Result{
|
return &Result{
|
||||||
Status: ret,
|
Status: ret,
|
||||||
GasUsed: vm.Gas,
|
GasUsed: vm.Gas,
|
||||||
SyscallCount: p.SyscallCount(),
|
SyscallCount: p.SyscallCount(),
|
||||||
ExecDur: dur,
|
ExecDur: dur,
|
||||||
PagesUsed: len(vm.Memory) / 65536,
|
PagesBeforeExec: pagesBefore,
|
||||||
StartTime: begin,
|
PagesUsed: len(vm.Memory) / 65536,
|
||||||
|
StartTime: begin,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue