File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed
Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export default function App() {
1111 const [ results , setResults ] = useState < any > ( [ ] ) ;
1212
1313 useEffect ( ( ) => {
14+ console . log ( 'Running Tests:' ) ;
1415 setResults ( [ ] ) ;
1516 runTests ( registerBaseTests ) . then ( ( results ) => {
1617 // Send results to host server
@@ -19,6 +20,7 @@ export default function App() {
1920 headers : { 'Content-Type' : 'application/json' } ,
2021 body : JSON . stringify ( results )
2122 } ) ;
23+ console . log ( JSON . stringify ( results , null , '\t' ) ) ;
2224 setResults ( results ) ;
2325 } ) ;
2426 } , [ ] ) ;
Original file line number Diff line number Diff line change @@ -392,22 +392,20 @@ export function registerBaseTests() {
392392 it ( 'Should queue simultaneous executions' , async ( ) => {
393393 let order : number [ ] = [ ] ;
394394
395- const operationCount = 20 ;
395+ const operationCount = 5 ;
396396 // This wont resolve or free until another connection free's it
397397 await db . writeLock ( async ( context ) => {
398- const fn = async ( x : number , index : number ) => {
399- try {
400- await context . execute ( 'SELECT * FROM User' ) ;
401- order . push ( index ) ;
402- } catch ( ex ) {
403- console . error ( ex ) ;
404- }
405- } ;
406-
407398 await Promise . all (
408399 Array ( operationCount )
409400 . fill ( 0 )
410- . map ( ( i , index ) => fn ( i , index ) )
401+ . map ( async ( x : number , index : number ) => {
402+ try {
403+ await context . execute ( 'SELECT * FROM User' ) ;
404+ order . push ( index ) ;
405+ } catch ( ex ) {
406+ console . error ( ex ) ;
407+ }
408+ } )
411409 ) ;
412410 } ) ;
413411
You can’t perform that action at this time.
0 commit comments