synopse / mORMot2

OpenSource RESTful ORM/SOA/MVC Framework for Delphi and FreePascal
https://synopse.info
Other
485 stars 122 forks source link

test.soa.core.pas(1789): E2003 Undeclared identifier: 'DefaultRotate' #263

Closed jimmckeeth closed 1 week ago

jimmckeeth commented 1 week ago

Cloned from cccd7ea

When trying to compile the tests get an error on the line: HTTPServer.HttpServer.Logger.DefaultRotate := hrtAfter1MB;

in both Delphi 12.1 and Lazarus 3.4 when compiling for Win32

Commenting it out and the tests compile, but a few tests then fail when running.

1.1. Core base: (FPC & Delphi)

 !  - Dmi smbios: 1 / 45 FAILED  1.65ms

1.2. Core process: (FPC)

  ! Core process - TDocVariant
  ! Exception ESynVariant at 010004c185 mormot2tests.dpr  (190): 2024-06-17 00:08:18 [TDocVariant.DispInvoke: invalid (1) call]
  ! Core process - BSON
  ! Exception EVariantInvalidOpError at 01001b39b9 test.soa.network.pas  (231): 2024-06-17 00:08:19 [Invalid variant operation]

1.4. Core crypto: (Delphi)

 !  - JWT: 2 / 214,107 FAILED  1.02s
 1000 mORMot HS256 in 898us i.e. 1M/s, aver. 898ns
 1000 mORMot HS384 in 1.87ms i.e. 520.8K/s, aver. 1.87us
 1000 mORMot HS512 in 1.92ms i.e. 508.6K/s, aver. 1.92us
 1000 mORMot S3224 in 980us i.e. 0.9M/s, aver. 980ns
 1000 mORMot S3256 in 876us i.e. 1M/s, aver. 876ns
 1000 mORMot S3384 in 861us i.e. 1.1M/s, aver. 861ns
 1000 mORMot S3512 in 862us i.e. 1.1M/s, aver. 862ns
 1000 mORMot S3S128 in 860us i.e. 1.1M/s, aver. 860ns
 1000 mORMot S3S256 in 902us i.e. 1M/s, aver. 902ns
 100 mORMot ES256 in 58.30ms i.e. 1.6K/s, aver. 583us
 100 mORMot RS256 in 31.20ms i.e. 3.1K/s, aver. 312us
 100 mORMot RS384 in 30.84ms i.e. 3.1K/s, aver. 308us
 100 mORMot RS512 in 32.29ms i.e. 3K/s, aver. 322us
 100 mORMot PS256 in 31.40ms i.e. 3.1K/s, aver. 314us
 100 mORMot PS384 in 32.04ms i.e. 3K/s, aver. 320us
 100 mORMot PS512 in 31.62ms i.e. 3K/s, aver. 316us
 100 TJwtCrypt ES256 in 58.05ms i.e. 1.6K/s, aver. 580us
 100 TJwtCrypt RS256 in 31.13ms i.e. 3.1K/s, aver. 311us
 100 TJwtCrypt RS384 in 31.13ms i.e. 3.1K/s, aver. 311us
 100 TJwtCrypt RS512 in 31.69ms i.e. 3K/s, aver. 316us
 100 TJwtCrypt PS256 in 32.27ms i.e. 3K/s, aver. 322us
 100 TJwtCrypt PS384 in 33.36ms i.e. 2.9K/s, aver. 333us
 100 TJwtCrypt PS512 in 33.32ms i.e. 2.9K/s, aver. 333us
synopse commented 1 week ago

Yes, I forgot a test file in our last commits. Detected last night by our continuous integration farm https://luti.tranquil.it/listfolder/0383f1ea-21ec-4d0e-b986-bc0bc289259f Fixed by https://github.com/synopse/mORMot2/commit/88797531

I don't have access to Delphi 12.1. The latest version I have access is Delphi 11.2 Alexandria, which has no trouble running the tests:

Windows 7 64bit SP1 (6.1.7601) [WinAnsi 4GB 1DB10B01]
    8 x 13th Gen Intel(R) Core(TM) i5-13500 [24MB] (x64)
    on VBOX - 1 Oracle VM VirtualBox Version 7.0.6 VGA BIOS
Using mORMot 2.2.7683
    TSqlite3LibraryStatic 3.44.2 with internal MM
Generated with: Delphi 11.2 Alexandria 64 bit Win compiler

Time elapsed for all tests: 57.75s
Performed 2024-06-17 08:58:07 by user1 on WIN7DEV

Total assertions failed for all test suits:  0 / 94,133,010
! All tests passed successfully.

Delphi 12 was reported to work with no issue: https://synopse.info/forum/viewtopic.php?id=6685

cadnan commented 1 week ago

I just installed Delphi 12.1 patch 1 (29.0.51961.7529) in a Windows Server 2022 Hyper-V VM. mormot2tests compiled without problems and when running them in VM I did get:

Total assertions failed for all test suits: 8 / 94,045,260

But they were related to 1.2 Core process: ! - Encode decode JSON: 3 / 581,960 FAILED 163.03ms ! - Mustache renderer: 5 / 62 FAILED 31.16ms

I then re-run mormot2tests on my host machine (Windows 11) and all tests passed.

This was Win32/Debug mode.. If needed I can try other combos..

cadnan commented 1 week ago

Just tested with Win64/Release configuration and the same outcome:

synopse commented 1 week ago

Can you publish the logs here (with detailed debug information enabled in the project options, so that we could have the stack trace)?

Thanks!

jimmckeeth commented 1 week ago

I looked in the compiler include files and don't see any options about enabling detailed debug information or stack traces. I ran the test in Debug configuration. Here is the Delphi 12.1 log files on Windows 11, Win32.

mormot2tests 240617131828.log

synopse commented 1 week ago

In the Delphi IDE, Project Options, enable detailed .map information generation.

jimmckeeth commented 1 week ago

Enabled the detailed MAP file, included debug information, and ran as Administrator. That didn't seem to change anything, but then I found the option to add LOG_VERBOSE which generated 1.7 GB of log data. I dug around some more and found an option to LOG_STACKTRACE, and that generated the attached log file.

mormot2tests 240617175930.log

synopse commented 1 week ago

Thanks a lot for the input.

Detail MAP file should have been enough. LOG_STACKTRACE is not needed in fact.

Run the mormot2tests once as administrator is enough to register its URI to http.sys. Your next runs could be as regular admin.

In you log, we can find the failure context in the stack trace: test.core.base.pas TTestCoreBase.DmiSmbios (6052) (the other "Error" lines are expected - only "Failed" is an issue) Maybe there is something weird in the SMBios data of your VM. I have hardened the SMBios test (see comment above).

Could you inspect in your debugger the _Smbios[] content, once you have executed line 6048: GetComputerUuid(uid); // retrieve main SMBIOS and its UUID, or generate it

jimmckeeth commented 1 week ago

I'm not running in a VM. I can test tomorrow maybe.

On Mon, Jun 17, 2024, 8:23 PM ab @.***> wrote:

Thanks a lot for the input.

Detail MAP file should have been enough. LOG_STACKTRACE is not needed in fact.

Run the mormot2tests once as administrator is enough to register its URI to http.sys. Your next runs could be as regular admin.

In you log, we can find the failure context in the stack trace: test.core.base.pas TTestCoreBase.DmiSmbios (6052) Maybe there is something weird in the SMBios data of your VM. I have hardened the SMBios test (see comment above).

Could you inspect in your debugger the _Smbios[] content, once you have executed line 6048: GetComputerUuid(uid); // retrieve main SMBIOS and its UUID, or generate it

— Reply to this email directly, view it on GitHub https://github.com/synopse/mORMot2/issues/263#issuecomment-2174081332, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGIVKSOYZ2LCC22SALGZT3ZH4STZAVCNFSM6AAAAABJNAINKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZUGA4DCMZTGI . You are receiving this because you authored the thread.Message ID: @.***>

jimmckeeth commented 1 week ago

New error when attempting to compile in both Delphi 12 and Lazarus

mormot.lib.openssl11.pas(10657,23) Error: Identifier not found "RawUtf8"

synopse commented 1 week ago

Yes, I am currently pushing some more commits.

Should be fine now.

jimmckeeth commented 1 week ago

FPC: Total assertions failed for all test suits: 18,522 / 93,982,125

Delphi Total assertions failed for all test suits: 0 / 94,159,502

synopse commented 1 week ago

My guess is that you were using a buggy version of FPC.

As stated by https://github.com/synopse/mORMot2?tab=readme-ov-file#compiler-targets

Note that FPC 3.2.2 has a regression with variant late binding - use FPC 3.2.2 fixes branch instead.

We use FPC and Lazarus as main dev system, with continuous integration on many platforms (including Mac M1 and RaspPi).