adoptium / adoptium/aqa-test-tools

Delay Generation of HW Specific Variables

Open
#121 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Jupyter Notebook
Stars
33
Forks
97
Avg merge
7h 9m
Merged PRs (30d)
5

Description

### Problem Description
Currently, we fetch the latest machine data file every time PerfNext is loaded. If some benchmark is selected and the machine data hasn't been fetched yet—fetching that can take a few seconds—then we can get an error while generating HW environment variables.

### Error
![image](https://user-images.githubusercontent.com/10422081/59793100-b8d80480-92a3-11e9-978a-120be48ee81a.png)

```
parser.js: Entering generateHWENV()
/Users/piyush/Work/Git/openjdk-test-tools/PerfNext/app/apis/BenchEngine/parser.js:453
var envVar = HW_ENV[property].$.name;
^

TypeError: Cannot read property 'name' of undefined
at generateHWENV (/Users/piyush/Work/Git/openjdk-test-tools/PerfNext/app/apis/BenchEngine/parser.js:453:38)
at /Users/piyush/Work/Git/openjdk-test-tools/PerfNext/app/apis/BenchEngine/parser.js:393:23
at /Users/piyush/Work/Git/openjdk-test-tools/PerfNext/app/apis/BenchEngine/parser.js:423:9
at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! PerfNext@0.0.1 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the PerfNext@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/piyush/.npm/_logs/2019-04-01T23_40_41_512Z-debug.log
Piyushs-MacBook-Pro:PerfNext piyush$
```

### Related Snippets

**Frontend: Call to Backend for Getting Machine List**
https://github.com/AdoptOpenJDK/openjdk-test-tools/blob/524d16e3784c17f4af6cee75f9105eb929397792/PerfNext/public/lib/js/benchmarks.js#L34-L40

**Backend: Get machine list**
https://github.com/AdoptOpenJDK/openjdk-test-tools/blob/524d16e3784c17f4af6cee75f9105eb929397792/PerfNext/app/apis/machines.js#L7-L24

**Snippet to Generate HW Specific Variables**
https://github.com/AdoptOpenJDK/openjdk-test-tools/blob/524d16e3784c17f4af6cee75f9105eb929397792/PerfNext/app/apis/BenchEngine/parser.js#L448-L460

### Proposed Changes

We need to find a workaround to prevent this issue.

Contributor guide

Open the contributing guide

Research direction

Start with app/apis/BenchEngine/parser.js around generateHWENV() and trace the machine-list request through app/apis/machines.js and public/lib/js/benchmarks.js. Reproduce startup with a benchmark selected before machine data is available. Done means HW environment generation no longer fails during that fetch and the selected benchmark can continue loading.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.