Skip to content

Commit 8dd364b

Browse files
committed
fix ci errors
1 parent 0ded0c4 commit 8dd364b

6 files changed

Lines changed: 22 additions & 39 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: mypy-check2
4545
uses: theCapypara/mypy-check@master
4646
with:
47-
requirements: types-toml
47+
requirements: types-toml numpy types-request mypy-protobuf
4848
path: "*.py"
4949
mypy_flags: "--config setup.cfg"
5050

celestial.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func main() {
141141
// listen for SIGINT
142142
c := make(chan os.Signal, 1)
143143

144-
signal.Notify(c, os.Interrupt, syscall.SIGINT, syscall.SIGTERM, syscall.SIGKILL)
144+
signal.Notify(c, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
145145

146146
<-c
147147

pkg/orchestrator/orchestrator.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ type Orchestrator struct {
3737

3838
virt VirtualizationBackend
3939

40-
host Host
41-
4240
initialized bool
4341
}
4442

pkg/orchestrator/types.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ const (
2626
ACTIVE
2727
)
2828

29-
const defaultLatency = 0
30-
const defaultBandwidth = 1000_000_000
31-
3229
type Link struct {
3330
// Blocked is true if the link is blocked
3431
Blocked bool
@@ -51,10 +48,6 @@ func (m MachineID) String() string {
5148
return fmt.Sprintf("%d.%d", m.Group, m.Id)
5249
}
5350

54-
func (m MachineID) lt(b MachineID) bool {
55-
return m.Group < b.Group || (m.Group == b.Group && m.Id < b.Id)
56-
}
57-
5851
type Host uint8
5952

6053
type NetworkState map[MachineID]map[MachineID]*Link

pkg/server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ func (s *Server) Update(stream celestial.Celestial_UpdateServer) error {
251251
}
252252
}
253253

254-
log.Debugf("parse time: %v", time.Now().Sub(parseStart))
254+
log.Debugf("parse time: %v", time.Since(parseStart))
255255

256256
err := s.o.Update(&orchestrator.State{
257257
NetworkState: ns,

test/integration/celestial_test.go

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -377,27 +377,23 @@ func testModifyLinks(t *testing.T, A int, B int, latency int) {
377377
u := &testUpdateServer{
378378
ld: []*celestial.StateUpdateRequest_NetworkDiff{
379379
{
380-
Id: &celestial.MachineID{
380+
Source: &celestial.MachineID{
381381
Group: uint32(vms[A].group),
382382
Id: uint32(vms[A].id),
383383
},
384-
Links: []*celestial.StateUpdateRequest_NetworkDiff_Link{
385-
{
386-
Target: &celestial.MachineID{
387-
Group: uint32(vms[B].group),
388-
Id: uint32(vms[B].id),
389-
},
390-
Latency: uint32(latency * 1000), // convert to microseconds
391-
Bandwidth: 10000,
392-
Next: &celestial.MachineID{
393-
Group: uint32(vms[B].group),
394-
Id: uint32(vms[B].id),
395-
},
396-
Prev: &celestial.MachineID{
397-
Group: uint32(vms[A].group),
398-
Id: uint32(vms[A].id),
399-
},
400-
},
384+
Target: &celestial.MachineID{
385+
Group: uint32(vms[B].group),
386+
Id: uint32(vms[B].id),
387+
},
388+
Latency: uint32(latency * 1000), // convert to microseconds
389+
Bandwidth: 10000,
390+
Next: &celestial.MachineID{
391+
Group: uint32(vms[B].group),
392+
Id: uint32(vms[B].id),
393+
},
394+
Prev: &celestial.MachineID{
395+
Group: uint32(vms[A].group),
396+
Id: uint32(vms[A].id),
401397
},
402398
},
403399
},
@@ -471,19 +467,15 @@ func TestBlockLink(t *testing.T) {
471467
u := &testUpdateServer{
472468
ld: []*celestial.StateUpdateRequest_NetworkDiff{
473469
{
474-
Id: &celestial.MachineID{
470+
Source: &celestial.MachineID{
475471
Group: uint32(vms[A].group),
476472
Id: uint32(vms[A].id),
477473
},
478-
Links: []*celestial.StateUpdateRequest_NetworkDiff_Link{
479-
{
480-
Target: &celestial.MachineID{
481-
Group: uint32(vms[B].group),
482-
Id: uint32(vms[B].id),
483-
},
484-
Blocked: true,
485-
},
474+
Target: &celestial.MachineID{
475+
Group: uint32(vms[B].group),
476+
Id: uint32(vms[B].id),
486477
},
478+
Blocked: true,
487479
},
488480
},
489481
}

0 commit comments

Comments
 (0)